This topic is now archived and is closed to further replies.


Getting X,Y back from a sprite (delphiX)

Recommended Posts

Hello, I have the following problem. I have a sprite, TShipBase = Class (TImageSprite) // snip // end; TForm1 = class(TForm) // snip // private BaseShip : TShipBase; public end; Then further down I want to find out where the sprite currently is. In the create section I set the X and Y with TShipBase.Create(DXSpriteEngine1.Engine) do begin Image := DXImageList1.Items[BASE_PIC]; x := 480; y := 120; // snip // end; So far no problem, but when I try to ask for the X and the Y coords the program crashes e.g. SpriteCoordX := baseship.x; The program compiles but it crashes when run. Can anyone point out my error? Ralph

Share this post

Link to post
Share on other sites