I think I see it. Its the DXInput1.Update line. When DXTimer is disabled input is not updated and game does not respond to keyboard/mouse.
So my suggestion is don't disable DXTimer. I suppose that you wanted to disable it so the game over text is displayed. I think that better solution is to make separate procedure for different game stages like intro, maingame and game over. Here is an example code:
Code:
type
TGameState = (gsIntro,gsMain,gsGameOver);
var
gameState : TGameState = gsIntro;
procedure Intro;
begin
//draws intro screen, main menu, etc
//if play option chosen then gamestate := gsMain;
end;
procedure Main;
begin
//updates input, updates player, enemies, draws everything
// if player is dead then gameState := gsGameOver
end;
procedure GameOver
begin
//displays gameover text
//if key pressed then gameState := gsIntro
end;
procedure TForm1.DXTimer1Timer(Sender : TObject; lagcount : integer);
begin
if not DXDraw1.CanDraw then exit;
case GameState of
gsIntro : intro;
gsMain : main;
gsGameOver : gameover;
end;
DXDraw1.Flip;
end;
And definately get rid of the second timer
Bookmarks