Hi everyone, I attach some of the code of my game written in delphi & delphiX. MyMen is a TList and consists of 19 men and they must move as per the TMan.DoMove procedure. How do I call the do move procedure in the playingStateMachine? If I use the SpriteEngine to move my road moves much too fast...

Maybe AthenaOfDelphi can help?

PS.: When I try to put the code in a block (code/pascal) some of it is cut off :evil:

[pascal]procedure TMan.DoMove(MoveCount: Integer);
begin
if (fHit) then
begin
Movement := 0;
Y := Y + 1;
end
else
begin
if (isUp in form1.DXInput1.States) then
Y := y + 2 else
if not(isUp in form1.DXInput1.States) then
Y := Y + 1;
if y > Form1.DXDraw1.Height - 100 then
dead;
if (Movement = 0) Then
Movement := Random(2);
if X > 560 Then Movement := 1;
if X <50>=fRedLightStart) then
fPlayingState:=_psPlaying
else
renderPlay;
end;
_psPlaying : begin
if (RedLight<>nil) then
begin
redlight.Move(1);
if (RedLight.Deaded) then
begin
RedLight.free;

RedLight:=nil;

end;
end;

car.Move(1);
road.Move(1);

// Now move the obstacles

begin
dxSpriteEngine1.Move(myMen.Count); // .....
end;

if (Car.deaded) then
begin
Car.free;

Car:=nil;

clearMen;

fGameState:=_gsEnd;
fEndState:=_esPlaySelected;

dxspriteEngine1.Items.clear;
end
else
renderPlay;
end;
end;
end;[/pascal]




MyMen := TList.create; is called in the OnFormCreate procedure.