PDA

View Full Version : Bugreports



Bones
04-10-2007, 09:29 AM
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.

Bones
04-10-2007, 11:00 AM
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 :


Procedure Do_Setup;
Begin
// --- Screen ---
Screen := TPHXScreen.getInstance();
Screen.Open('Invaders',-1,-1,800,600,False);

// --- Setup Canvas ---
Canvas := TPHXCanvas.Create;

// --- Setup timer ---
Timer:= TPHXTimer.Create;

// --- Collisions --- //
ColEngine := TPHXCollisionEngine.Create;

// --- Load images from map --- //
AllImages := TPHXImageList.Create;
AllImages.LoadImage('1945.phximg');
SpriteEngine := TPHXSpriteEngine.Create;
SpriteEngine.ImageList:= AllImages;

// --- Create a new layer with our spriteset --- //
SpriteEngine.Layers.Add(TPHXSpriteLayer.Create( SpriteEngine, '1945.png' ) );
CreateSprites(SpriteEngine, AllImages);

{--- Input --- }
Input:= TPHXInput.Create;
Input.Keyboard.KeyBinding[isButton1]:= KeyBinding(VK_SPACE);
Input.Keyboard.KeyBinding[isButton2]:= KeyBinding( Ord('B'), Ord('2'));
Input.Keyboard.KeyBinding[isButton3]:= KeyBinding( Ord('C'), Ord('3'));
Input.Keyboard.KeyBinding[isButton4]:= KeyBinding( VK_DELETE);

// --- set up the font for text output ---
Font := TPHXFont.Create;
Font.LoadFont('Arial16.phxfnt');

End;



Sprites displaying correctly:



Procedure Do_Setup;
Begin
// --- Screen ---
Screen := TPHXScreen.getInstance();
Screen.Open('Invaders',-1,-1,800,600,False);

// --- set up the font for text output ---
Font := TPHXFont.Create;
Font.LoadFont('Arial16.phxfnt');

// --- Setup Canvas ---
Canvas := TPHXCanvas.Create;

// --- Setup timer ---
Timer:= TPHXTimer.Create;

// --- Collisions --- //
ColEngine := TPHXCollisionEngine.Create;

// --- Load images from map --- //
AllImages := TPHXImageList.Create;
AllImages.LoadImage('1945.phximg');
SpriteEngine := TPHXSpriteEngine.Create;
SpriteEngine.ImageList:= AllImages;

// --- Create a new layer with our spriteset --- //
SpriteEngine.Layers.Add(TPHXSpriteLayer.Create( SpriteEngine, '1945.png' ) );
CreateSprites(SpriteEngine, AllImages);

{--- Input --- }
Input:= TPHXInput.Create;
Input.Keyboard.KeyBinding[isButton1]:= KeyBinding(VK_SPACE);
Input.Keyboard.KeyBinding[isButton2]:= KeyBinding( Ord('B'), Ord('2'));
Input.Keyboard.KeyBinding[isButton3]:= KeyBinding( Ord('C'), Ord('3'));
Input.Keyboard.KeyBinding[isButton4]:= KeyBinding( VK_DELETE);
End;
//----------------------------------------------------------------------------------//