Getting X,Y back from a sprite (delphiX)
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement