📄 kota43a.pas
字号:
end;
procedure TForm1.AttackENS;
begin
with STG1.PD[0] do
case SelectNo of
0,2 : begin
STG1.EntryPlayerShot(x-10,y-15,-3,-9, 0,0,45,45, 4, 4);
STG1.EntryPlayerShot(x+10,y-15,3,-9, 0,0,45,45, 4, 4);
end;
1 : begin
STG1.EntryPlayerShot(x-10,y-15,-4,-11, 0,0,45,45, 4, 4);
STG1.EntryPlayerShot(x+10,y-15, 4,-11, 0,0,45,45, 4, 4);
end;
end;
end;
procedure TForm1.AttackBom;
var
iii : Integer;
begin
with STG1.PD[0] do
case SelectNo of
0 : begin
for iii := 1 to 9 do
begin
STG1.EntryPlayerShot(x,y-iii*45-40,0,0, 0,0,45,45, 4, 3);
STG1.EntryPlayerShot(x+iii*20,y-iii*35,0,0, 0,0,45,45, 4, 3);
STG1.EntryPlayerShot(x-iii*20,y-iii*35,0,0, 0,0,45,45, 4, 3);
end;
end;
1 : begin
for iii := 0 to 12 do
begin
STG1.EntryPlayerShot(x+AL.SinT2(iii*120) div 18,y-iii*25,0,0, 0,0,45,45, 4, 3);
STG1.EntryPlayerShot(x-AL.SinT2(iii*120) div 18,y-iii*25,0,0, 0,0,45,45, 4, 3);
end;
end;
2 : begin
for iii := 0 to 7 do
begin
STG1.EntryPlayerShot(x+AL.SinT2(iii*128+42) div 17,y-40+AL.CosT2(iii*128+42) div 17,0,0, 0,0,45,45, 4, 3);
STG1.EntryPlayerShot(x+AL.SinT2(iii*128+84) div 12,y-40+AL.CosT2(iii*128+84) div 12,0,0, 0,0,45,45, 4, 3);
STG1.EntryPlayerShot(x+AL.SinT2(iii*128+0 ) div 24,y-40+AL.CosT2(iii*128+0 ) div 24,0,0, 0,0,45,45, 4, 4);
//STG1.EntryPlayerShot(x+AL.SinT2(iii*128) div 12,y-40+AL.CosT2(iii*128) div 12,0,0, 0,0,45,45, 4, 4);
end;
end;
end;
end;
//-----------------------------------------
procedure TForm1.ImageDraw;
var
fx : DDBLTFX;
begin
ZeroMemory(@fx,sizeof(DDBLTFX)); //摿庩岠壥偼僫僔側偺偱丄0偱杽傔
fx.dwSize:=sizeof(DDBLTFX); //偱傕丄dwSize偼擖傟偰偍偔昁梫偑偁傞
//摿庩Mode
if (NoHitMode = True)then STG1.DrawFont(50,20,'GOD MODE',3);
//FRM悢
if (GetTickCount and $3FF > 512)then
STG1.DrawFont(270,22,'FPSx'+IntToStr(Frame2),3);
//嵞惗帪昞婰
if (PlayRec = True)then STG1.DrawFont(150,15,'REC '+IntToStr(PlayFrm),3);
if (SamplePlay = True)then STG1.DrawFont(150,15,'PLAY '+IntToStr(PlayFrm),3);
if (demoPlay = True)then STG1.DrawFont(150,110,'DEMONSTRATION',0);
if (DrawSize = 0)then
begin
//DDDD1.WaitVBlank;
//STG1.FrontBuf.PutFast(170,90,rect(0,0,300,300),DDBLTFAST_WAIT or DDBLTFAST_NOCOLORKEY);
//DDDD1.Flip;
DDDD1.FrontBuffer.surface.BltFast(170,90,STG1.BackBuf.surface,rect(0,0,300,300),
DDBLTFAST_WAIT or DDBLTFAST_NOCOLORKEY);
end
else
begin
if (BltMode = 0)then
begin //僜僼僩僂僃傾奼戝
STG1.TempBuf.Blt(STG1.BackBuf,rect(0,0,450,450),
rect(0,0,300,300),DDBLT_WAIT,fx);
//DDDD1.WaitVBlank;
DDDD1.FrontBuffer.surface.BltFast(95,15,STG1.TempBuf.surface,rect(0,0,450,450),
DDBLTFAST_WAIT or DDBLTFAST_NOCOLORKEY);
//DDDD1.Flip;
end
else //僴亅僪僂僃傾奼戝
begin
//DDDD1.WaitVBlank;
DDDD1.FrontBuffer.Blt(STG1.BackBuf,rect(95,15,545,465),
rect(0,00,300,300),DDBLT_WAIT,fx);
//DDDD1.Flip;
end;
end;
end;
procedure TForm1.GamePause;
begin
STG1.Draw;
//STG1.DrawBank(150,150,1,4,8,0);
STG1.DrawFont(150,150,'PAUSE',2);
ImageDraw;
if ((Key1.Trig1 = True)and(Key1.Trig2 = True)and(Key1.Trig3 = True))then
begin
FedeOut;
BGMDisable;
Level2 := 1;
Level1 := 5;
end;
{if (((GetAsyncKeyState($50) and $8000) <> 0)and
(PlayRec = False)) then //棤媄
begin
STG1.PD[0].bom := 5;
STG1.PD[0].SLEVEL := 60;
STG1.EntrySound(11);
end; }
if (KEY1.PTrig4 = True)then Level1 := 2;
end;
//僞僀僩儖儊僯儏亅-----------------------
procedure TForm1.TitleMenu;
begin
if (level2 = 1)then
begin
BGMEnable('bgm\title');
level2 := 0; cy := 0;cx := 0;
StageNo := 1;StageFile := 'stage1.stg';
PlayFrm := 0; PlayRec := False;
SamplePlay := False;
stg1.dif := diffcult;
NoHitMode := False;
TitleCount := 0;
DemoPlay := False;
end;
STG1.PutBackFace(title,0,0,rect(0,0,300,300),1);
//if ((GetAsyncKeyState($52) and $8000) <> 0) then PlayRec := True; //棤媄
if (Key1.PUp = true)then cy := cy - 1;
if (key1.Pdown = true)then cy := cy + 1;
if ((Key1.PUp or key1.Pdown) = true)then
begin cx := 0; STG1.EntrySound(10); titlecount := 0;end;
if (cy > 7)then cy := 7;
if (cy < 0)then cy := 0;
AL.BlendRect(STG1.BackBuf,rect(80,170,220,280),96,BM_DEC);
STG1.DrawFont(230,295,'VERSION 20',3);
//start/Diff/SE/BGM/Exit/HIsco
STG1.DrawFont(150,190,'MAIN GAME',3);
STG1.DrawFont(150,200,'STAGE SELECT',3);
STG1.DrawFont(150,210,'SCORE RANKING',3);
STG1.DrawFont(150,220,'REPLAY MODE',3);
STG1.DrawFont(150,230,'RECORD MODE',3);
STG1.DrawFont(150,240,'CONFIG',3);
STG1.DrawFont(150,250,'BGM MODE',3);
STG1.DrawFont(150,260,'GAME EXIT',3);
AL.BlendRect(STG1.BackBuf,rect(80,185+cy*10,220,195+cy*10),40,BM_SCREEN);
if ((Key1.Ptrig1 or Key1.Ptrig2 or Key1.Ptrig3)=True)then
begin
STG1.EntrySound(9);
cx := 0;
case cy of
0 : begin //Main Game
Level1 := 13;
Level2 := 1;
STG1.Dif := Diffcult - 1;
STG1.PD[0].score := 0;
FedeOut;
StageSel := False;
end;
1 : begin //Stage Select
Level1 := 20;
Level2 := 1;
STG1.Dif := Diffcult - 1;
STG1.PD[0].score := 0;
FedeOut;
StageSel := True;
PlayRec := False;
end;
2 : Level1 := 9;
3 : begin //SamplePlay
FedeOut;
SamplePlay := True;
PlayRec := False;
StageSel := False;
level1 := 15;
level2 := 1;
end;
4 : begin //RecPlay
FedeOut;
STG1.Dif := Diffcult - 1;
SamplePlay := False;
PlayRec := True;
StageSel := False;
level1 := 15;
level2 := 1;
end;
5 : begin
Level1 := 11;
cy := 0;
end;
6 : begin
Level1 := 14;
Level2 := 1;
end;
7 : begin
FedeOut;
close;
end;
end;
end;
inc(TitleCount);
if (TitleCount > 500)then
begin
//Level2 := 1;
//Level1 := 21;
DemoPlay := True;
SamplePlay := True;
PlayRec := False;
StageSel := False;
//
stg1.LoadPlayData('Demo.PDF',ppd);
StageNo := 1;
StageFile :='Stage1.stg';
PlayFrm := 0;
STG1.Dif := PPD.Dif;
STG1.PD[0].score := 0;
case PPD.playerType of //婡懱
0 : begin
STG1.PD[0].Speed1 := 5;
STG1.PD[0].Speed2 := 4;
end;
1 : begin
STG1.PD[0].Speed1 := 6;
STG1.PD[0].Speed2 := 5;
end;
2 : begin
STG1.PD[0].Speed1 := 5;
STG1.PD[0].Speed2 := 5;
end;
end;
STG1.PD[0].SelectNo := PPD.Playertype;
Level1 := 1;
Level2 := 1;
end;
ImageDraw;
end;
procedure TForm1.Continue;
begin
STG1.Draw;
if (PlayRec = True)then
begin
PlayRec := False;
PlayDataWrite;
end;
STG1.DrawBank(150,150,1,5,8,0);
STG1.DrawFont(150,220,'TRY AGAIN',0);
STG1.DrawFONT(150,250,'GIVE UP GAME',0);
if((key1.Pup or key1.Pdown) = True)then cy := (cy + 1) mod 2;
if((key1.Pup or key1.Pdown) = True)then STG1.EntrySound(10);
STG1.DrawBank(40,220+cy*30,5,3,9,0);
STG1.DrawBank(260,220+cy*30,6,3,9,0);
ImageDraw;
if ((KEY1.PTrig1 or Key1.PTrig2 or Key1.PTrig3) = True)then
case cy of
0 : begin
if (StageSel = False)then HiScoreCheck;
with STG1.PD[0] do
begin
Empty := True;
x := 150;
y := 250;
a1 := 0; //孹偒
a2 := 150; //SLP
a3 := 0; //抏寕偪娫妘偺惂屼
SLevel := 65; //ShotLevel
score := 0;
bom := 3; //儃儉
PNo := 2; //巆婡
HP := 4;
NoHit := 80; //柍揋帪娫
end;
Level1 := 2;
Level2 := 1;
cy := 0;
end;
1 : begin
cy := 0;
Level1 := 8;
if (StageSel = False)then HiScoreCheck;
end;
end;
end;
procedure TForm1.GameOver;
begin
BGMDisable;
STG1.Draw;
STG1.DrawBank(150,150,1,1,8,0);
ImageDraw;
if ((KEY1.PTrig1 or Key1.PTrig2 or Key1.PTrig3) = True)then
begin
Level2 := 1;
Level1 := 5;
FedeOut;
end;
end;
procedure TForm1.HiScoreCheck;
var
iii,aaa : Integer;
begin
with STG1 do
begin
aaa := 10;
for iii := 0 to 8 do
if (SCR.Score[DIF+1][8-iii] < PD[0].score)then aaa := 8-iii+1;
if (aaa < 9)then
for iii := 0 to 8-aaa do
begin
SCR.score[DIF+1][8-iii] := SCR.score[DIF+1][7-iii];
SCR.Name[DIF+1][8-iii] := SCR.Name[DIF+1][7-iii];
SCR.PlayType[DIF+1][8-iii] := SCR.PlayType[DIF+1][7-iii];
SCR.Stage[DIF+1][8-iii] := SCR.Stage[DIF+1][7-iii];
end;
SCR.score[DIF+1][aaa-1] := PD[0].score;
SCR.Name[DIF+1][aaa-1] := PD[0].Name;
SCR.PlayType[DIF+1][aaa-1] := PD[0].SelectNo; //PlayType
SCR.Stage[DIF+1][aaa-1] := STG1.StageNo;
end;
end;
procedure TForm1.ScoreRanking;
var
iii,jjj,aaa : Integer;
begin
STG1.Clear;
STG1.BackBuf.BltFast(Title,0,0,rect(0,300,300,600),0);
STG1.DrawFont(150,20,'(HI SCORE RANKING)',1);
STG1.DrawFont(152,22,'(HI SCORE RANKING)',0);
case Level2 of
0 : STG1.DrawFont(150,40,'EASY',2);
1 : STG1.DrawFont(150,40,'NORMAL',2);
2 : STG1.DrawFont(150,40,'HARD',2);
end;
for iii := 0 to 8 do
begin
STG1.DrawFont(30,70+iii*25,IntToStr(iii+1),0);
STG1.DrawFont(70,70+iii*25,STG1.SCR.name[Level2,iii],0);
STG1.DrawFont(240,70+iii*25,'STAGE '+IntToStr(STG1.SCR.Stage[Level2,iii]),3);
STG1.DrawBank(280,70+iii*25,STG1.SCR.PlayType[Level2,iii]+1,3,9,0);
for jjj := 0 to 6 do
begin
aaa := (STG1.SCR.score[Level2][iii] div trunc(power(10,jjj))) mod 10;
if (jjj > 3)then STG1.DrawBank(185-jjj*12,70+iii*25,aaa+1,2,9,0)
else STG1.DrawBank(185-jjj*12,70+iii*25,aaa+1,1,9,0);
end;
end;
ImageDraw;
if ((KEY1.PTrig1 or Key1.PTrig2 or Key1.PTrig3) = True)then
begin
Level2 := Level2 + 1;
STG1.EntrySound(9);
if (Level2 = 3)then begin Level2 := 0; Level1 := 5; end;
end;
end;
//Ver Disp
procedure TForm1.VerDisp;
var
Loading : TDDDDSurface;
begin
Loading := TDDDDSurface.CreateOnSystemMemory(DD,200,32,0);
Loading.LoadBMP('bmp\load.bmp');
DD.Clear;
DD.Flip;
DD.Clear;
Loading.PutFast(220,180,rect(0,0,200,32),DDBLTFAST_NOCOLORKEY);
DD.Flip;
Loading.free;
end;
//Config
procedure TForm1.Config;
var
iii,jjj : Integer;
tcol : array[0..12] of Byte;
begin
STG1.Clear;
STG1.BackBuf.BltFast(Title,0,0,rect(0,300,300,600),0);
for iii := 0 to 12 do tcol[iii] := 1;
if (Key1.PUp = true)then cy := cy - 1;
if (key1.Pdown = true)then cy := cy + 1;
if ((Key1.PUp or key1.Pdown) = true)then STG1.EntrySound(10);
if (cy > 11)then cy := 11;
if (cy < 0)then cy := 0;
tcol[cy] := 0;
STG1.DrawFont(150,15,'CONFIG',1);
STG1.DrawFont(152,12,'CONFIG',0);
STG1.DrawFont(150,50,'RETURN TO MENU',tcol[0]);
STG1.DrawFont(100,70,'GAME LEVEL',tcol[1]);
STG1.DrawFont(250,70,ans[Diffcult+2],2);
STG1.DrawFont(100,90,'SCREEN SIZE',tcol[2]);
STG1.DrawFont(250,90,ans[DrawSize+5],2);
STG1.DrawFont(100,110,'SE SOUND',tcol[3]);
STG1.DrawFont(250,110,ans[STG1.SEOff],2);
STG1.DrawFont(100,130,'BGM SOUND',tcol[4]);
STG1.DrawFont(250,130,ans[BGMSound],2);
STG1.DrawFont(100,150,'WAVE VOLUME',tcol[5]);
STG1.DrawFont(250,150,IntToStr(-STG1.WaveVolume),2);
STG1.DrawFont(100,170,'SLOW MODE',tcol[6]);
STG1.DrawFont(250,170,ans[SlowWait],2);
STG1.DrawFont(100,190,'STRETCH BLT',tcol[7]);
STG1.DrawFont(250,190,ans[BLTMode+7],2);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -