📄 kota43a.pas
字号:
if (FileExists(aaa) = True)then
begin
BGMWAVE:=TDDSDWaveData.Create(DDSD1,aaa);
DDSD1.Channels[8].WaveData:=BGMWAVE;
DDSD1[8].LoopPlay;
BGMPlay := True;
BGMPlayMode := 1;
sleep(500);
end;
end;
end;
end;
end;
procedure TForm1.BGMDisable;
begin
BGMName := 'None';
if (midi_ok = 1)then Exit;
if (BGMPlay = True)then
begin
case BGMPlayMode of
0 : begin
KBGMStop;
KBGMFree(MidiHandle);
end;
1 : begin
DDSD1[8].Stop;
BGMWAVE.Free;
end;
end;
end;
BGMPlay := False;
end;
//僨亅僞亅俴倧倎倓------------------------------------------------
procedure TForm1.DataLoad;
begin
if (FileExists('bmp\Title.bmp') = False)then begin Close; exit; end;
title := TDDDDSurFace.CreateOnSystemMemory(DD,300,600,0);
title.LoadBMP('bmp\title.bmp');
if (FileExists('bmp\select2.bmp') = False)then Close;
Select2 := TDDDDSurFace.CreateOnSystemMemory(DD,250,100,0);
Select2.LoadBMP('bmp\select2.bmp');
if (FileExists('bmp\select.bmp') = False)then Close;
Select1 := TDDDDSurFace.CreateOnSystemMemory(DD,300,450,0);
Select1.LoadBMP('bmp\select.bmp');
STG1.EntryBank('bmp\player.bmp',50,50,7,3,0,true,true);
//1...Bom
STG1.EntryBank('bmp\bom.bmp',48,47,4,4,1,false,true); //
//2...ComShot
STG1.EntryBank('bmp\comshot'+IntToStr(ShotColor+1)+'.bmp',16,16, 34,1 ,2,false,true);
//3...MyShot
STG1.EntryBank('bmp\myshot.bmp',8,24,6,1,3,false,true);
//4...effect
STG1.EntryBank('bmp\effect.bmp',8,8,18,1,4,false,true);
//5...Naprm
STG1.EntryBank('bmp\myshot2.bmp',48,48,16,1,5,false,false);
//8...message
STG1.EntryBank('bmp\mes1.bmp',300,50,1,10,8,false,false);
//9...font
STG1.EntryBank('bmp\font1.bmp',12,18,11,1,9,false,false);
//29...destroy
STG1.EntryBank('bmp\destroy.bmp',50,50,1,1,29,false,true);
//28...messeage2
STG1.EntryBank('bmp\font2.bmp',16,16,20,1,28,false,true);
STG1.EntryBank('bmp\font3.bmp',8,8,20,1,27,false,true);
//26..FlashBom
STG1.EntryBank('bmp\bom2.bmp',100,100,3,1,26,false,false);
//Laser
STG1.EntryBank('bmp\comshot_ls.bmp',40,300,1,1,25,false,false);
//10...揋1
STG1.EntryBank('bmp\Enemy1.bmp',60,40,3,1,10,true,true);
//11...揋2
STG1.EntryBank('bmp\Enemy2.bmp',100,100,5,1,11,true,true);
//12...揋3
STG1.EntryBank('bmp\enemy3.bmp',70,61,7,1,12,true,true);
//13...揋4
STG1.EntryBank('bmp\Enemy4.bmp',150,87,1,1,13,true,true);
//14...揋5 敋抏栰榊
STG1.EntryBank('bmp\Enemy5.bmp',50,50,9,1,14,true,true);
//15...揋6 僈儔僗栰榊
STG1.EntryBank('bmp\Enemy6.bmp',50,50,9,1,15,true,true);
//16...揋7 惵偄棳惎
STG1.EntryBank('bmp\Enemy7.bmp',50,50,9,1,16,true,true);
//17...揋8 朇戜
STG1.EntryBank('bmp\Enemy8.bmp',50,50,9,1,17,true,true);
//18...揋8 朇戜
STG1.EntryBank('bmp\Enemy9.bmp',50,50,9,1,18,true,true);
//19...揋8 朇戜
STG1.EntryBank('bmp\Enemy10.bmp',50,50,9,1,19,true,true);
//20...揋8 拞儃僗
STG1.EntryBank('bmp\Enemy11.bmp',146,134,9,1,20,true,true);
//慁夞偡傞揋
STG1.EntryBank('bmp\Enemy12.bmp',50,50,10,1,21,true,true);
//彫宆塹惎
STG1.EntryBank('bmp\Enemy13.bmp',50,50,10,1,22,true,true);
//夞揮朇戜
STG1.EntryBank('bmp\Enemy14.bmp',64,64,5,1,23,True,true);
STG1.EntrySoundBank('se\bom4.wav',0,0);
STG1.EntrySoundBank('se\bom5.wav',1,1);
STG1.EntrySoundBank('se\bom6.wav',2,2);
STG1.EntrySoundBank('se\bom7.wav',3,3);
STG1.EntrySoundBank('se\shot5.wav',4,4); //Myshot
STG1.EntrySoundBank('se\shot3.wav',5,5); //Enemy Boll
STG1.EntrySoundBank('se\shot6.wav',6,6); //Enemy LongBow
STG1.EntrySoundBank('se\shot7.wav',7,7); //Enemy BigBoll
STG1.EntrySoundBank('se\shot8.wav',7,14);
STG1.EntrySoundBank('se\warning2.wav',3,8);
STG1.EntrySoundBank('se\decide1.wav',0,9);
STG1.EntrySoundBank('se\decide2.wav',1,10);
STG1.EntrySoundBank('se\Get1.wav',7,11);
STG1.EntrySoundBank('se\1UP.wav',3,12);
STG1.EntrySoundBank('se\ENS.wav',4,13);
STG1.EntrySoundBank('se\laser2.wav',4,15);
Level2 := 1;
Level1 := 21;
//僼僅儞僩戝偺岆嵎梡
Form1.ClientWidth := 640;
Form1.ClientHeight := 480;
end;
//僎亅儉儊僀儞儖亅僠儞----------------------------
procedure TForm1.GamePlay;
begin
if (KEY1.PTrig4 = True)then Level1 := 4;
if (STG1.StageClear = True)then
begin
StageNo := StageNo + 1;
if (StageNo = 6)then Level1 := 30 //AllStageClear
else Level1 := 7; //next stage
if (StageSel = True)then Level1 := 8;
end;
if (STG1.PD[0].Empty = False)then begin CCount := 400; Level1 := 6; end;
if ((STG1.BOD[0].Empty = true)and //BOSS BGM
(STG1.MCount = 5)and(STG1.MNo = 3))then
if (StageNo<5)then BGMEnable('bgm\boss')
else BGMEnable('bgm\boss2');
if (STG1.PD[0].HP > 0)then PlayerSub;
STG1.PlaySTG;
STG1.Draw;
if (STG1.mesivent > 120)then PlayerIvent;
if ((SamplePlay = True)and(GetTickCount and $3FF > 512))then
begin
//STG1.DrawFont(240,275,'PLAY '+IntToStr(PlayFrm),3); //榐夋Play
STG1.DrawFont(80,250,'RETURN TO TITLE',3);
STG1.DrawFont(80,262,'PUSH ANY KEY',3);
end;
//擄堈搙
case STG1.dif of
0 : STG1.DrawFont(150,4,'NORMAL',3);
1 : STG1.DrawFont(150,4,'HARD',3);
-1: STG1.DrawFont(150,4,'EASY',3);
end;
ImageDraw;
{if ((GetAsyncKeyState($50) and $8000) <> 0) then //棤媄
begin
STG1.StageClear := True;
end; }
end;
//(game->game)梡弶婜愝掕----------------------------
procedure TForm1.StageLoad;
begin
FedeOut;
BGMDisable;
STG1.DataClear2; //僨亅僞亅偺False壔
STG1.Drawfont(150,250,'STAGE DATA NOW LOADING',3);
ImageDraw;
with STG1.PD[0] do
begin
HP := 4;
NoHit := 50; //柍揋帪娫
a2 := 0;
x := 150;
y := 200;
end;
stagefile := 'stage'+intToStr(StageNo)+'.stg';
if (FileExists(stagefile) = False)then close;
STG1.EntryStage(stagefile,StageNo);
STG1.SetUpStage(10);
STG1.LoadBoss('',StageNo);
STG1.LoadPlayerMes('mes\stage'+IntToStr(StageNo)+IntToStr(STG1.PD[0].SelectNo+1)+'.mes');
//BGM
BGMEnable('bgm\stage'+IntToStr(StageNo));
Level1 := 2;
//Message
STG1.EntryPText(100,70,'',5);
STG1.EntryPText(100,70,'STAGE NO '+IntToStr(StageNo),1);
//STG1.EntryPText(100,100,'',5);
STG1.EntryPText(120,150,'MISSION START',1);
//STG1.EntryPText(100,130,'',5);
STG1.EntryPText(150,180,'ARE YOU READY',1);
//STG1.EntryPText(150,180,'',5);
//STG1.EntryPText(150,180,STG1.BossName,3);
//Flags
STG1.BackESD := 0;
STG1.BossFlash := 0;
STG1.FlashCount := 0;
STG1.BDCount := 0;
STG1.PDCount := 0;
DeleteShot := 0;
AL.RndStep := 0;
end;
//(Title->Game)梡弶婜愝掕----------------------------
procedure TForm1.GameStart;
begin
with STG1.PD[0] do
begin
Empty := True;
h1 := 0; //摉偨傝敾掕
h2 := -3;
h3 := 4;
h4 := 4;
hit := True;
x := 150;
y := 250;
a1 := 0; //孹偒
a2 := 0; //SLP
a3 := 0; //抏寕偪娫妘偺惂屼
score := 0;
bom := 3; //儃儉
PNo := 2; //巆婡
HP := 4;
NoHit := 50; //柍揋帪娫
end;
STG1.PointScore := 100;
STG1.PD[0].SLevel := 0; //Shot偺嫮偝
if (StageSel = True)then STG1.PD[0].SLevel := 65;
STG1.DestroyEnemy := 0; //Item弌尰曄悢
StageLoad;
PlayFrm := 0; //PlayFrm悢
end;
//帺婡堏摦丒僾儗僀儎亅憖嶌---------------------------------------------
procedure TForm1.PlayerSub; //慡僉儍儔摨偠
var
ax1,ay1,asp : SmallInt;
iii : Integer;
begin
ax1 := 0; ay1 := 0; asp := STG1.PD[0].Speed1;
//曽岦僉亅偺敾掕
if (KEY1.Trig1 = True)then asp := STG1.PD[0].Speed2;
if (KEY1.Left = True)then ax1 := ax1 - 1;
if (KEY1.Right = True)then ax1 := ax1 + 1;
if (KEY1.Up = True)then ay1 := ay1 - 1;
if (KEY1.Down = True)then ay1 := ay1 + 1;
STG1.PD[0].a1 := STG1.PD[0].a1 + ax1*2;
if (STG1.PD[0].a1 <> 0)then STG1.PD[0].a1 := STG1.PD[0].a1 - abs(STG1.PD[0].a1) div STG1.PD[0].a1;
if (STG1.PD[0].a1 < -9)then STG1.PD[0].a1 := -9;
if (STG1.PD[0].a1 > 9)then STG1.PD[0].a1 := 9;
if ((ax1<>0)and(ay1<>0))then //幬傔堏摦偼堏摦検傪彮側偔偡傞
begin
STG1.PD[0].x := STG1.PD[0].x + ax1*round(asp/1.3);
STG1.PD[0].y := STG1.PD[0].y + ay1*round(asp/1.3);
end
else
begin
STG1.PD[0].x := STG1.PD[0].x + ax1*asp;
STG1.PD[0].y := STG1.PD[0].y + ay1*asp;
end;
//夋柺奜偐傜弌偰偟傑偭偨
if (STG1.PD[0].x > 290)then STG1.PD[0].x := 290;
if (STG1.PD[0].x < 10) then STG1.PD[0].x := 10;
if (STG1.PD[0].y > 290)then STG1.PD[0].y := 290;
if (STG1.PD[0].y < 10) then STG1.PD[0].y := 10;
if (STG1.PD[0].SelectNo < 2)then //0&1
begin
//抏偺敪幩娫妘挷惍僼儔僌
STG1.PD[0].a2 := STG1.PD[0].a2 + 1;
if (STG1.PD[0].a2 > 153)then STG1.PD[0].a2 := 153;
STG1.PD[0].a3 := STG1.PD[0].a3 - 1;
if (STG1.PD[0].a3 < 0)then STG1.PD[0].a3 := 0;
//捠忢抏偺寕偪偩偟
if (STG1.PD[0].a3 = 0)then
if ((KEY1.Trig1 = True) and (STG1.PD[0].a2 > 3))then
begin
STG1.EntrySound(4);
STG1.PD[0].a3 := 3;
STG1.PD[0].a2 := STG1.PD[0].a2 - 2;
STG1.EntryEffect(STG1.PD[0].x-12,STG1.PD[0].y-12,0,0,6);
STG1.EntryEffect(STG1.PD[0].x+12,STG1.PD[0].y-12,0,0,6);
AttackShot;
end;
end
else
begin
STG1.PD[0].a2 := STG1.PD[0].a2 + 1;
if (STG1.PD[0].a2 > 153)then STG1.PD[0].a2 := 153;
//儗亅僓亅寕偪偩偟
if (KEY1.Trig1 = True)then
begin
STG1.EntrySound(15);
AttackShot;
end;
end;
//乽僫僷亅儉棴傑偭偨傛乿偺墘弌
if (STG1.PD[0].a2 mod 50 = 0)then
begin
STG1.EntryEffect(STG1.PD[0].a2 div 2 + 20,291,0,0,3);
//STG1.EntryEffect(STG1.PD[0].x,STG1.PD[0].y,0,0,2);
end;
//僫僷亅儉偺寕偪偩偟
if ((KEY1.PTrig2 = True) and (STG1.PD[0].a2 > 50))then
begin
STG1.PD[0].a2 := STG1.PD[0].a2 - 50;
STG1.EntrySound(13);
AttackENS;
end;
//僉働儞両両儃儉敪幩両両
if ((KEY1.PTrig3 = True) and (STG1.PD[0].BOM > 0))then //BOM
begin
STG1.PD[0].NoHit := 60;
//STG1.EnemyShotClear;
for iii := 0 to 200 do
if not(STG1.ESD[iii].kind = 5)then STG1.ESD[iii].empty := False;
STG1.PD[0].BOM := STG1.PD[0].BOM - 1;
STG1.EntrySound(2);
AttackBom;
DeleteShot := 30;
end;
//抏徚偟婜娫
if (DeleteShot > 0)then dec(DeleteShot);
if (DeleteShot > 0)then
for iii := 0 to 200 do
if not(STG1.ESD[iii].kind = 5)then STG1.ESD[iii].empty := False;
//偁偨傝敾掕
if ((STG1.PlayerHit = True)and(STG1.PD[0].NoHit = 0))then
begin
//Sleep(1500);
STG1.EntryBom(STG1.PD[0].x,STG1.PD[0].y,0,0,9);
STG1.EntryBom(STG1.PD[0].x,STG1.PD[0].y,0,0,1);
STG1.PD[0].NoHit := 60;
if (NoHitMode = False)then STG1.PD[0].HP := STG1.PD[0].HP - 1;
end;
end;
//僾儗僀儎亅僔儑僢僩--------------------------------------
procedure TForm1.AttackShot;
begin
with STG1.PD[0] do
case(SelectNo) of
0 : begin
case (SLevel div 20) of
0 : begin //俼俤俢 俴俬俧俫俿俶俬俶俧
STG1.EntryPlayerShot(x-10,y-7,-1,-20, 0,-10,2,10, 2, 9);
STG1.EntryPlayerShot(x+10,y-7,1,-20, 0,-10,2,10, 2, 9);
end;
1 : begin
STG1.EntryPlayerShot(x-10,y-7,-2,-20, 0,-10,2,10, 2, 6);
STG1.EntryPlayerShot(x ,y-7,0,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+10,y-7,2,-20, 0,-10,2,10, 2, 6);
end;
2 : begin
STG1.EntryPlayerShot(x-8,y-7,0,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+8,y-7,0,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+10,y-7,3,-17, 0,-10,2,10, 3, 4);
STG1.EntryPlayerShot(x-10,y-7,-3,-17, 0,-10,2,10, 1, 4);
end;
3 : begin
STG1.EntryPlayerShot(x-10,y-7,-1,-20, 0,-10,2,10, 2, 4);
STG1.EntryPlayerShot(x ,y-7,0,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+10,y-7,1,-20, 0,-10,2,10, 2, 4);
STG1.EntryPlayerShot(x+10,y-7,3,-17, 0,-10,2,10, 3, 4);
STG1.EntryPlayerShot(x-10,y-7,-3,-17, 0,-10,2,10, 1, 4);
end;
end;
end;
1 : begin
case (SLevel div 20) of
0 : begin //俥俷俼俠俤 俛俬俼俢
STG1.EntryPlayerShot(x-10,y-7,-1,-20, 0,-10,2,10, 2, 9);
STG1.EntryPlayerShot(x+10,y-7,1,-20, 0,-10,2,10, 2, 9);
end;
1 : begin
STG1.EntryPlayerShot(x-10,y-7,-3,-20, 0,-10,2,10, 2, 6);
STG1.EntryPlayerShot(x ,y-7,0,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+10,y-7,3,-20, 0,-10,2,10, 2, 6);
end;
2 : begin
STG1.EntryPlayerShot(x-8,y-7,-1,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+8,y-7,1 ,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+10,y-7,5,-17, 0,-10,2,10, 3, 4);
STG1.EntryPlayerShot(x-10,y-7,-5,-17,0,-10,2,10, 1, 4);
end;
3 : begin
STG1.EntryPlayerShot(x-10,y-7,-3,-20, 0,-10,2,10, 2, 4);
STG1.EntryPlayerShot(x ,y-7,0,-20, 0,-10,2,10, 2, 8);
STG1.EntryPlayerShot(x+10,y-7,3,-20, 0,-10,2,10, 2, 4);
STG1.EntryPlayerShot(x+10,y-7,7,-17, 0,-10,2,10, 3, 4);
STG1.EntryPlayerShot(x-10,y-7,-7,-17,0,-10,2,10, 1, 4);
end;
end;
end;
2 : begin
case (SLevel div 20) of
0,1 : begin //MeTA
STG1.EntryPlayerShot(x,(y-14) div 2,0,0,
0,0,40,y, 10, 3);
end;
2 : begin
STG1.EntryPlayerShot(x,(y-14) div 2,0,0,
0,0,40,y, 10, 4);
end;
3 : begin
STG1.EntryPlayerShot(x,(y-14) div 2,0,0,
0,0,40,y, 10, 5);
end;
end;
end;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -