end;
if X_KordCar<=Left_death_dot then
begin
X_KordCar:=Left_death_dot;//ограничение слева
if Speed<-0.001 then begin Speed:=Speed+0.00002; GasDeley:=1; end;//Уменьшение скорости при прикосновении к бардюру слева
end
else
if (PressedKey[27]=true)and(CountTickTimer>100) then
Selected_Menu_item:='';
Menu_item:=2;
CountTickTimer:=0;
Speed:=0.0;
Pause:=false;
sound:=false;
CountFuel:=8;
CountKM:=0;
if Selected_Menu_item='' then //Нажата клавиша Esc в игре или ничего не выбрано
if SpeedGL.MediaPlayer1.FileName<>'Textures\Video\SL_Start_Logo.avi' then
if SpeedGL.MediaPlayer1.FileName<>'Sound\Main_Menu.mp3' then begin
SpeedGL.MediaPlayer1.FileName:='Sound\Main_Menu.mp3';
SpeedGL.MediaPlayer1.Open;
SpeedGL.MediaPlayer1.Play;
if CountTickTimer>100 then begin
if PressedKey[27]=true then
SpeedGL.MediaPlayer1.Stop;
SpeedGL.MediaPlayer1.Close;
SpeedGL.MediaPlayer1.FileName:='';
Selected_Menu_item:='Exit';
if PressedKey[40]=true then
Inc(Menu_item);
PlaySound('Sound\Select_MainMenu.wav',0,SND_ASYNC);
end; //вниз
if PressedKey[38]=true then
Dec(Menu_item);
end;//вверх
if CountTickTimer>1000 then CountTickTimer:=110;
if Menu_item>4 then Menu_item:=1;//ограничение
if Menu_item<1 then Menu_item:=4;// в пределах 4 пунктов
if PressedKey[13]=true then begin
PlaySound('Sound\Choose_MainMenu.wav',0,SND_ASYNC);
case Menu_item of
1:begin
Selected_Menu_item:='Start';
Score:=0;
FuelGoToWay:=false;
NextKM_GenerFuel:=1;
CountNitro:=0;
MinusFuel:=0.00002;
Y_KordFuel:=1.5;
GasDeley:=1;
Gas:=false;
NextKmEnymy:=0.3;
Y_Enymi:=1.2;
2:begin Selected_Menu_item:='Car'; end;
3:begin Selected_Menu_item:='Actors'; end;
4:begin Selected_Menu_item:='Exit'; end;
if Selected_Menu_item='Actors' then //Нажата клавиша Sound
if SpeedGL.MediaPlayer1.FileName<>'Sound\Actor.mp3' then begin
SpeedGL.MediaPlayer1.FileName:='Sound\Actor.mp3';
if Selected_Menu_item='Car' then //Нажата клавиша Car
begin //Car
if SpeedGL.MediaPlayer1.FileName<>'Sound\Garage.mp3' then begin
SpeedGL.MediaPlayer1.FileName:='Sound\Garage.mp3';
OldSelectMenyItem:='Car';
if PressedKey[37]=true then
Dec(CarMenuItem);
LeftButton:=true;
PlaySound('Sound\Select_CarMenu.wav',0,SND_ASYNC);
if PressedKey[39]=true then
Inc(CarMenuItem);
RightButton:=true;
if CarMenuItem>4 then CarMenuItem:=1;
if CarMenuItem<1 then CarMenuItem:=4;
end; //Car
end;//CountTickTimer
if Selected_Menu_item='Exit' then //Нажата клавиша Exit в гланом меню
SpeedGL.MediaPlayer1.Free;
Application.Terminate;
Application.ProcessMessages;
InvalidateRect(SpeedGL.Handle, nil, False);//перерисовка
if (Symvol=0)and
(PressedKey[78]=true)and
(CountNitro>0)and
(GasDeley=1) then
Gas:=true;
CountNitro:=CountNitro-1;
GasDeley:=0;
PlaySound('Sound\Start_Nitro.wav',0,SND_ASYNC);
событие OnPaint:
procedure TSpeedGL.FormPaint(Sender: TObject);
var
ps:TPaintStruct;
BeginPaint(dc,ps);
if Selected_Menu_item='' then
1:begin LeftTiresMeny:=-0.849; RightTiresMeny:=0.8; TopTiresMeny:=0.76; end;
2:begin LeftTiresMeny:=-1.1; RightTiresMeny:=1.0; TopTiresMeny:=0.4; end;
3:begin LeftTiresMeny:=-0.8; RightTiresMeny:=0.8; TopTiresMeny:=0.0; end;
4:begin LeftTiresMeny:=-0.8; RightTiresMeny:=0.8; TopTiresMeny:=-0.58; end;
if OldSelectMenyItem='Car' then begin
if RemoveMeny>=0.0 then begin RemoveMeny:=0.0; OldSelectMenyItem:='' end else
Страницы: 1, 2, 3, 4, 5