Results 1 to 2 of 2

Thread: Bugreports

  1. #1

    Bugreports

    Hi..

    I thought I'd create a little thread dedicated to little problems that I find in the library as I go along. Please note that I'm not trying to be clever or criticize the great work thats been put into Phoenix, I just thought it would be a nice way to centralize the various problems that are popping up here and there. There is no point in me simply fixing them locally, as then no-one would be able to compile my code.


    The first one :

    The collision method in the unit phxSprites is mis-spelled as Collission

    Its obviously just a typo as it is spelled correctly in other places in the unit, but it does mean that any procedure that is descended or derived from this perpetuates the error.
    Check out my Delphi programs, music and writing.
    <br />http://digitalfunnybone.com/Programming.html

  2. #2

    White blobs instead of sprites.

    Here's an interesting one.
    It seems that if i set up my font AFTER I load images and sprite-engine graphics, the sprites all display as white squares, its probably not a bug but it did keep me busy for a few hours trying to figure it out.

    White square sprites :
    Code:
    Procedure Do_Setup;
    Begin
      // --- Screen ---
      Screen &#58;= TPHXScreen.getInstance&#40;&#41;;
      Screen.Open&#40;'Invaders',-1,-1,800,600,False&#41;;
    
      // --- Setup Canvas ---
      Canvas &#58;= TPHXCanvas.Create;
    
      // --- Setup timer ---
      Timer&#58;= TPHXTimer.Create;
    
      // --- Collisions --- //
      ColEngine &#58;= TPHXCollisionEngine.Create;
    
      // --- Load images from map --- //
      AllImages &#58;= TPHXImageList.Create;
      AllImages.LoadImage&#40;'1945.phximg'&#41;;
      SpriteEngine &#58;= TPHXSpriteEngine.Create;
      SpriteEngine.ImageList&#58;= AllImages;
    
      // --- Create a new layer with our spriteset --- //
      SpriteEngine.Layers.Add&#40;TPHXSpriteLayer.Create&#40; SpriteEngine, '1945.png' &#41; &#41;;
      CreateSprites&#40;SpriteEngine, AllImages&#41;;
    
      &#123;--- Input --- &#125;
      Input&#58;= TPHXInput.Create;
      Input.Keyboard.KeyBinding&#91;isButton1&#93;&#58;= KeyBinding&#40;VK_SPACE&#41;;
      Input.Keyboard.KeyBinding&#91;isButton2&#93;&#58;= KeyBinding&#40; Ord&#40;'B'&#41;, Ord&#40;'2'&#41;&#41;;
      Input.Keyboard.KeyBinding&#91;isButton3&#93;&#58;= KeyBinding&#40; Ord&#40;'C'&#41;, Ord&#40;'3'&#41;&#41;;
      Input.Keyboard.KeyBinding&#91;isButton4&#93;&#58;= KeyBinding&#40; VK_DELETE&#41;;
    
      // --- set up the font for text output ---
      Font &#58;= TPHXFont.Create;
      Font.LoadFont&#40;'Arial16.phxfnt'&#41;;
    
    End;
    Sprites displaying correctly:

    Code:
    Procedure Do_Setup;
    Begin
      // --- Screen ---
      Screen &#58;= TPHXScreen.getInstance&#40;&#41;;
      Screen.Open&#40;'Invaders',-1,-1,800,600,False&#41;;
    
      // --- set up the font for text output ---
      Font &#58;= TPHXFont.Create;
      Font.LoadFont&#40;'Arial16.phxfnt'&#41;;
    
      // --- Setup Canvas ---
      Canvas &#58;= TPHXCanvas.Create;
    
      // --- Setup timer ---
      Timer&#58;= TPHXTimer.Create;
    
      // --- Collisions --- //
      ColEngine &#58;= TPHXCollisionEngine.Create;
    
      // --- Load images from map --- //
      AllImages &#58;= TPHXImageList.Create;
      AllImages.LoadImage&#40;'1945.phximg'&#41;;
      SpriteEngine &#58;= TPHXSpriteEngine.Create;
      SpriteEngine.ImageList&#58;= AllImages;
    
      // --- Create a new layer with our spriteset --- //
      SpriteEngine.Layers.Add&#40;TPHXSpriteLayer.Create&#40; SpriteEngine, '1945.png' &#41; &#41;;
      CreateSprites&#40;SpriteEngine, AllImages&#41;;
    
      &#123;--- Input --- &#125;
      Input&#58;= TPHXInput.Create;
      Input.Keyboard.KeyBinding&#91;isButton1&#93;&#58;= KeyBinding&#40;VK_SPACE&#41;;
      Input.Keyboard.KeyBinding&#91;isButton2&#93;&#58;= KeyBinding&#40; Ord&#40;'B'&#41;, Ord&#40;'2'&#41;&#41;;
      Input.Keyboard.KeyBinding&#91;isButton3&#93;&#58;= KeyBinding&#40; Ord&#40;'C'&#41;, Ord&#40;'3'&#41;&#41;;
      Input.Keyboard.KeyBinding&#91;isButton4&#93;&#58;= KeyBinding&#40; VK_DELETE&#41;;
    End;
    //----------------------------------------------------------------------------------//
    Check out my Delphi programs, music and writing.
    <br />http://digitalfunnybone.com/Programming.html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL