Hello!

Nice to see Delphi(X) being discussed so often!

To contribute to this I've got a question.

We've been working on a space shooter called SpacePirates as our first game using Delphi 5 and DelphiX and we've stumbled on a problem... Collision detection.

I've checked the tutorials that come with DelphiX (especially Sprite Tutorial (the shooter)) and the collision works fine there.

But when I tried to create (in our game) a "coin" sprite that rotates the coin with 8 images the collision seems to work flawlessly only with the 1st image of the animation...

If the 1st image of the animation is drawn onto the screen the bullet that "collides" with the coin does its stuff (deals damage, destroys the Bullet sprite, etc.) but if the coin "has" any other image the bullet flies right "through" it...

I've been able to "cheat" my way through it so far by increasing the speed of the animation but we've decided to add some "squishers" (you know, the machine that slams itself closed and then opens again repeatedly and "squishes" anything in it's path) and now it's obvious that we won't be able to cheat our way out of this "mess".

So to describe the "Squisher" problem in detail...
The whole animation looks somthing like this:
----OO---- (1st pic)
--O....O-- (2nd pic)
-O.......O- (3rd pic)
O...........O (4th pic)
where - is "the metallic rod" that holds the O which is some sort of a "fist". The dot is empty space.

-> The problem is that when the player collides with the 1st picture it works fine, the player dies.

-> The 2nd picture "works" but not always. If the player collides with it, death is imminent, however, shooting it produces various results. The bullet may hit the rod/fist or it may not... which, of course, sux big time.

-> The 3rd and 4th picture don't work at all. The player may fly over them as if they didn't exist (but are drawn!). The Player dies if the "squisher" loops from the 4th to the 1st the picture.

The picture is 640*80 (= 640*20*4 Images).

There are no probs with proper image drawing. I check the transparent color by checking the pixel(0,0) color.

I used the same process to create an ImageSprite as in the tutorial.

Item creation procedure:

constructor TItems.Create(AParent: TSprite);
begin
inherited Create(AParent);
PixelCheck := true;
end;

...
with TItems.Create(Form1.DXSpriteEngine.Engine) do
begin
Image := Form1.DXImageList.Items[Itemz[a].ImageNumber];
Width := Image.PatternWidth;
Height := Image.PatternHeight;

AnimCount := Image.PatternCount;
AnimPos := 0;
AnimStart := 0;
AnimSpeed := Pic[Itemz[a].PicNumber].AnimSpeed/1000;
AnimLooped := true;

...

end;
...

Any ideas on fixing the problem efficiently (FPS now is about 70).

The game can be found at http://redpoint.no-ip.com/bojzgames but is still under development and can crash/not start. It should work on Win2k, though.

BojZ