📄 kota43a.pas
字号:
STG1.DrawFont(100,210,'BACK GROUND',tcol[8]);
STG1.DrawFont(250,210,ans[STG1.BackCut],2);
STG1.DrawFont(100,230,'EDIT WAIT',tcol[9]);
if (EditWait <> 9)then STG1.DrawFont(250,230,IntToStr(EditWait-5),2)
else STG1.DrawFont(250,230,'NO WAIT',2);
STG1.DrawFont(100,250,'SHOT COLOR',tcol[10]);
STG1.DrawFont(250,250,ans[ShotColor+11],2);
STG1.DrawFont(100,270,'BGM SELECT',tcol[11]);
STG1.DrawFont(250,270,ans[BGMMode+14],2);
//STG1.DrawFont(150,280,'HISCORE DELETE',tcol[11]);
for iii := 0 to 9 do
begin
AL.Blendrect(STG1.BackBuf,rect(iii*15,40+cy*20,iii*15+15,60+cy*20),44-iii,BM_ADD);
AL.Blendrect(STG1.BackBuf,rect(300-iii*15,40+cy*20,285-iii*15,60+cy*20),44-iii,BM_ADD);
end;
if ((Key1.Ptrig1 or Key1.Ptrig2 or Key1.Ptrig3)=True)then
begin
STG1.EntrySound(9);
case cy of
0 : begin
CY := 5;
Level1 := 5;
end;
1 : Diffcult := (diffcult + 1) mod 3;
2 : begin
DrawSize := (DrawSize + 1) mod 2;
DDDD1.Clear;
DDDD1.Flip;
DDDD1.Clear;
DDDD1.Flip;
end;
3 : STG1.SEOff := (STG1.SEOff + 1) mod 2;
4 : begin
BGMSound := (BGMSound + 1) mod 2;
if (BGMSound = 0)then BGMEnable('bgm\title')
else BGMDisable;
end;
5 : STG1.WaveVolume := (STG1.WaveVolume + 1) mod 10;
6 : SlowWait := (SlowWait + 1) mod 2;
7 : BltMode := (BltMode + 1) mod 2;
8 : STG1.BackCut := (STG1.BackCut + 1) mod 2;
9 : Editwait := (Editwait + 1) mod 10;
10: begin
ShotColor := (ShotColor + 1) mod 3;
if (FileExists('bmp\comshot'+IntToStr(ShotColor+1)+'.bmp') = true)then
STG1.EntryBank('bmp\comshot'+IntToStr(ShotColor+1)+'.bmp',16,16, 34,1 ,2,false,true);
end;
11 :begin
BGMMode := (BGMMode + 1) mod 2;
BGMEnable('bgm\title');
end;
12: begin
STG1.EntrySound(3);
for iii := 0 to 5 do
for jjj := 0 to 9 do
begin
STG1.SCR.score[iii,jjj] := 0;
STG1.SCR.Name[iii,jjj] := 'XXX';
STG1.SCR.PlayType[iii,jjj] := 1;
STG1.SCR.Stage[iii,jjj] := 0;
end;
end;
end;
end;
ImageDraw;
end;
//---僉儍儔僙儗僋僩
procedure TForm1.Select;
begin
if (level2 = 1)then
begin
level2 := 0;
cy := 0;
cx := 10;
SecCount := 0;
SecCount2:= 2; //婡懱偺悢乮嵟弶偼2丄塀偟偑弌尰偱3乯
end;
STG1.BackBuf.BltFast(Title,0,0,rect(0,300,300,600),0);
Flag1 := (Flag1 + 1) mod 40;
STG1.WaveDraw(rect(0,25,300,75),abs(10 - Flag1 div 2));
if (Key1.Pup = True)then
begin
cy := (cy + 1) mod SecCount2;
SecCount := SecCount + 1;
end;
if (SecCount > 5)then SecCount2 := 3; //塀偟婡懱弌尰両
if (Key1.PDown = True)then cy := (cy - 1 + SecCount2) mod SecCount2;
if ((Key1.PUp or key1.Pdown) = true)then
begin STG1.EntrySound(10); cx := 10; end;
if (cx > 0)then cx := cx - 1;
//僉儍儔夋憸
STG1.DrawBank(150,50,1,4,8,4);
STG1.DrawFont(150,270,'SELECT PLAY CHARACTER',3);
AL.FillRect(STG1.BackBuf,rect(0,100,300,250),0);
STG1.BackBuf.BltFast(Select1,0,100,rect(0,cy*150,300,cy*150+150),DDBLTFAST_SRCCOLORKEY);
if (cx > 0)then Alph1.WindNoise(STG1.BackBuf,rect(0,100,300,250),cx*10);
if ((GetTickCount div 500) mod 2 = 1)then
begin
STG1.DrawBank(150,90,7,3,9,0);
STG1.DrawBank(150,260,8,3,9,0);
end;
if ((Key1.Ptrig1 or Key1.Ptrig2 or Key1.Ptrig3)=True)then
case cy of
0 : begin
STG1.PD[0].Speed1 := 5;
STG1.PD[0].Speed2 := 4;
STG1.PD[0].SelectNo := 0;
cy := 0;
Level1 := 1;
Level2 := 1;
end;
1 : begin
STG1.PD[0].Speed1 := 6;
STG1.PD[0].Speed2 := 5;
STG1.PD[0].SelectNo := 1;
cy := 0;
Level1 := 1;
Level2 := 1;
end;
2 : begin
STG1.PD[0].Speed1 := 5;
STG1.PD[0].Speed2 := 5;
STG1.PD[0].SelectNo := 2;
cy := 0;
Level1 := 1;
Level2 := 1;
end;
end;
if(((GetAsyncKeyState($10) and $8000) <> 0)and(PlayRec = False))
then NoHitMode := True
else NoHitMode := False;
ImageDraw
end;
procedure TForm1.FedeOut;
var
iii,jjj,xxx,yyy : Integer;
Tile : array[0..5,0..5] of Byte;
fx:DDBLTFX;
rc : TRect;
TempTime : LongInt;
begin
ZeroMemory(@fx,sizeof(DDBLTFX));
fx.dwFillColor := 0;
fx.dwSize:=sizeof(DDBLTFX);
for iii := 0 to 5 do
for jjj := 0 to 5 do
Tile[jjj,iii] := 0;
for iii := 0 to 24+10 do
begin
TempTime := GetTickCount;
if (iii < 25)then
begin
xxx := random(5);
yyy := random(5);
while(tile[xxx,yyy] > 0)do
begin
xxx := random(5);
yyy := random(5);
end;
tile[xxx,yyy] := 1;
end;
for jjj := 0 to 24 do
begin
xxx := jjj mod 5;
yyy := jjj div 5;
if ((tile[xxx,yyy] > 0)and(tile[xxx,yyy] < 10))then
begin
with rc do
begin
top:=yyy*60;
left:=xxx*60;
right:=xxx*60+60;
bottom:=yyy*60+60;
end;
fx.dwFillColor := 28-tile[xxx,yyy]*2;
tile[xxx,yyy] := tile[xxx,yyy] + 1;
STG1.BackBuf.surface.Blt(rc,nil,rc, //偙偆偟側偄偲徚偣側偄偧
DDBLT_COLORFILL or DDBLT_WAIT,fx);
end;
end;
ImageDraw;
while ((GetTickCount-TempTime)<25)do;
end;
end;
//--------test梡
procedure TForm1.TestPlay;
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;
STG1.DestroyEnemy := 0; //Item弌尰曄悢
BGMDisable;
STG1.DataClear2; //僨亅僞亅偺False壔
FedeOut;
STG1.Drawfont(200,275,'(NOW LOADING)',0);
ImageDraw;
with STG1.PD[0] do
begin
HP := 4;
NoHit := 50; //柍揋帪娫
a2 := 0;
end;
//
stagefile := 'test.stg';
stageNo := 4;
//
if (FileExists(stagefile) = False)then begin close; exit; end;
STG1.EntryStage(stagefile,stageNo);
STG1.SetUpStage(10);
STG1.LoadBoss('',StageNo);
//BGM
BGMEnable('bgm\stage'+IntToStr(StageNo));
sleep(1000);
Level1 := 2;
//Message
STG1.EntryPText(0,0,'',4);
STG1.EntryPText(225,70,'STAGE '+IntToStr(StageNo),1);
STG1.EntryPText(200,150,'ENEMY TARGET',1);
STG1.EntryPText(150,190,STG1.BossName,1);
end;
//僗僥亅僕儌亅僪
procedure TForm1.StageSelect;
var
iii : Integer;
tcol : array[0..5] of Byte;
begin
if (level2 = 1)then
begin
BGMEnable('bgm\select'); level2 := 0;
cy := 0;
cx := 0;
end;
for iii := 0 to 5 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 > 4)then cy := 4;
if (cy < 0)then cy := 0;
tcol[cy] := 0;
STG1.Clear;
STG1.BackBuf.BltFast(Title,0,0,rect(0,300,300,600),0);
STG1.DrawFont(150,30,'STAGE SELECT',1);
STG1.DrawFont(153,33,'STAGE SELECT',0);
STG1.DrawFont(150,45,'1STAGE PLAY MODE',3);
STG1.DrawFont(130,100,'STAGE1',tcol[0]);
STG1.DrawFont(150,115,'NIGHT CITY',3);
STG1.BackBuf.BltFast(select2,15,75,rect(0,tcol[0]*50,50,50+tcol[0]*50),0);
STG1.DrawFont(170,140,'STAGE2',tcol[1]);
STG1.DrawFont(150,155,'TRASH AREA',3);
STG1.BackBuf.BltFast(select2,225,115,rect(50,tcol[1]*50,100,50+tcol[1]*50),0);
STG1.DrawFont(130,175,'STAGE3',tcol[2]);
STG1.DrawFont(150,190,'TANK FACTORY',3);
STG1.BackBuf.BltFast(select2,15,150,rect(100,tcol[2]*50,150,50+tcol[2]*50),0);
STG1.DrawFont(170,215,'STAGE4',tcol[3]);
STG1.DrawFont(150,230,'DRAKNESS GATE',3);
STG1.BackBuf.BltFast(select2,225,190,rect(150,tcol[3]*50,200,50+tcol[3]*50),0);
STG1.DrawFont(130,250,'STAGE5',tcol[4]);
STG1.DrawFont(150,265,'LOST CODE',3);
STG1.BackBuf.BltFast(select2,15,225,rect(200,tcol[4]*50,250,50+tcol[4]*50),0);
if ((Key1.Ptrig1 or Key1.Ptrig2 or Key1.Ptrig3)=True)then
begin
STG1.EntrySound(9);
StageNo := CY+1;
Level1 := 12;
Level2 := 1;
end;
ImageDraw;
end;
procedure TForm1.NameEntry;
var
jjj,iii : Integer;
acx,acy : Integer;
begin
if (level2 = 1)then
begin
cx := 0; //暥帤僇亅僜儖
cy := 0; //柤慜僇亅僜儖
aa1 := 0;
Level2 := 0;
NameEnt[0] := ' ';
NameEnt[1] := ' ';
NameEnt[2] := ' ';
BGMEnable('bgm\select');
end;
aa1 := (aa1 + 1) mod 30;
if ((Key1.PUp = true)and(cx>8))then cx := cx - 9;
if ((key1.Pdown = true)and(cx<18))then cx := cx + 9;
if (Key1.PLeft = true)then cx := cx - 1;
if (Key1.PRight = true)then cx := cx + 1;
if ((Key1.PUp or key1.Pdown or Key1.PLeft or Key1.PRight) = true)
then begin aa1 := 0; STG1.EntrySound(10); end;
if (cx > 26)then cx := 26;
if (cx < 0)then cx := 0;
if ((Key1.PTrig2 = True)and(cy>0))then
begin
NameEnt[cy] := ' ';
cy := cy - 1;
NameEnt[cy] := ' ';
end;
if (Key1.PTrig1 = True)then
begin
STG1.EntrySound(9);
NameEnt[cy] := copy('ABCDEFGHIJKLMNOPQRSTUVWXYZ ',cx+1,1);
cy := cy + 1;
end;
//NextLevel = 12;
STG1.BackBuf.BltFast(Title,0,0,rect(0,300,300,600),0);
STG1.WaveDraw(rect(0,25,300,75),abs(10 - Flag1 div 2));
STG1.DrawBank(150,50,1,6,8,4);
STG1.DrawFont(75,130,'YOUR NAME',3);
AL.BlendRect(STG1.BackBuf,rect(0,170,300,180),35,BM_SCREEN);
AL.BlendRect(STG1.BackBuf,rect(140,140,160,145),160,BM_SCREEN);
AL.BlendRect(STG1.BackBuf,rect(170,140,190,145),160,BM_SCREEN);
AL.BlendRect(STG1.BackBuf,rect(200,140,220,145),160,BM_SCREEN);
STG1.DrawFont(150,200,'A B C D E F G H I',0);
STG1.DrawFont(150,230,'J K L M N O P Q R',0);
STG1.DrawFont(150,260,'S T U V W X Y Z ',0);
for iii := 0 to 2 do
STG1.DrawFont(150+iii*30,130,NameEnt[iii],0);
for iii := 0 to 2 do
for jjj := 0 to 8 do
AL.BlendRect(STG1.BackBuf,rect(10+jjj*32,205+iii*30,30+jjj*32,210+iii*30),160,BM_SCREEN);
AL.BlendRect(STG1.BackBuf,rect(140+cy*30,120,160+cy*30,140),80+abs(aa1-15),BM_SCREEN);
acx := cx mod 9;
acy := cx div 9;
//AL.BlendRect(STG1.BackBuf,rect(10+acx*32,190+acy*30,30+acx*32,210+acy*30),30+abs(aa1-15),BM_SCREEN);
AL.BlendRect(STG1.BackBuf,rect(18+acx*32,0,22+acx*32,300),30+abs(aa1-15),BM_SCREEN);
AL.BlendRect(STG1.BackBuf,rect(0,198+acy*30,300,202+acy*30),30+abs(aa1-15),BM_SCREEN);
ImageDraw;
if (cy = 3)then
begin
Level1 := 12;
Level2 := 1;
FedeOut;
STG1.PD[0].Name := NameEnt[0] + NameEnt[1] + NameEnt[2];
end;
end;
procedure TForm1.AllClear;
begin
//榐夋廔椆
BGMDisable;
if (PlayRec = True)then begin PlayDataWrite; PlayRec := False; end;
if (StageSel = False)then HiScoreCheck;
Level1 := 22;
end;
procedure TForm1.PlayDataWrite;
begin
//廔椆抣=255
PPD.PlayData[PlayFrm-1] := 255;
PPD.Score := STG1.PD[0].score;
PPD.Dif := STG1.Dif;
PPD.Name := STG1.PD[0].Name;
PPD.PlayerType := STG1.PD[0].SelectNo;
PPD.Stage := StageNo;
stg1.SavePlayData('PlayData\PlayData'+IntToStr(RecNo)+'.PDF',ppd);
PlayFrm := 0;
end;
//僆亅僾僯儞僌
procedure TForm1.OpeningDemo;
begin
BGMDisable;
demo1.Present;
StartDemo;
Key1.GetKey; //側偤偐昁梫丒丒丒
Level1 := 5;
Level2 := 1;
end;
//僄儞僨傿儞僌
procedure TForm1.EndingDemo;
begin
//STG1.Draw;
//STG1.DrawBank(150,150,1,6,8,0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -