Jump to content
  • Advertisement


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


Getting X,Y back from a sprite (delphiX)

This topic is 6064 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Guest Anonymous Poster

baseShip := TShipBase.create(..);
with baseship do begin;

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!