Ok, I had a look at the example that ships with delphi x and got it to work:
Code:
procedure TPlayer.DoMove(MoveCount: Integer);
var
MyX: Double;
MyY : Double;
begin
if fMode = 0 then
begin
If moveLeft and
(x>5) then
X := X - 10;
If moveright and
((X+Form1.DXImageList1.Items.Find('Player').Width)<Form1>5) then
Y := Y - 10;
if Movedown and
(y<form1.DXDraw1.Height-65)then
Y:= Y + 10;
MyX := X; //Set Temporary variable
MyY := y;
If isButton1 in Form1.DXInput1.States Then
begin
if (FTamaCount<300>=35) then
begin
Inc(FTamaCount);
with TBullet.Create(Form1.DXSpriteEngine1.Engine) do
begin
Image := Form1.DXImageList1.Items.Find('Bullet');
Form1.DXWaveList1.Items.Find('Fire').Play(False);
X := MyX + 30;
Y := MyY;
Width := Image.Width;
Height := Image.Height;
end;
FOldTamaTime := FCounter;
end;
end;
end;
FCounter := FCounter + MoveCount;
end;
But, I need to display the time in seconds, can it be done with the dxtimer?
Thanks :-)
Bookmarks