Ну у нас есть такой тег...
вот:
Исходный код
{$APPTYPE GUI}
uses Windows,BassFPC,
Graphix,GxCRT,Gx2D,
GxIMG,gximeff,gxtext,gxdrw;
type
TBass = object
Stream :Array[1..80] of HStream;
Procedure InitBass;
Procedure load_music(name:string;num:integer);
Procedure play_music(num:integer);
end;
// TBass.
Procedure TBass.InitBass;
Begin
if BASS_GetVersion() <> MAKELONG(2,0) then begin Halt; end;
if not BASS_Init(1, 44100, 0, 0, nil) then begin end;
End;
Procedure TBass.load_music(name:string;num:integer);
var
p : PChar;
Begin
p := PChar(name);
stream[num] := BASS_StreamCreateFile(FALSE,p,0,0,0);
if (stream[num] = 0) then begin end;
End;
Procedure TBass.play_music(num:integer);
Begin
if not BASS_StreamPlay(stream[num], FALSE, 0) then begin end;
End;
//var
var
sound:TBass;
image1,image2,p:Pointer; { gamer }
wimage1,wimage2,wp:Pointer; { 2 player }
bum,wins,wars,gras:pointer; {system}
c:byte;
w,ww:longint;
x,y,wx,wy,tx,ty:longint;
rk:boolean;
CHsys:PFontFNT;
s:string;
life1,life2:byte;
rp1,rp2:record len,x,y,w:longint end;
p1,p2,win:boolean;
v:word;
rotatewar:boolean;
begin
InitGraphiX(ig_col16,ig_col16);
SetModeGraphiX(1024,768,ig_col16);
bar(0,0,getmaxx,getmaxy,rgbcolorrgb(24,146,91));
new(CHsys,LoadFont('font1.fnt'));
CHsys^.outtext(getmaxx div 2,getmaxy div 2,'LOAD ...',rgbcolorrgb(255,255,255));
Sound.initBass;
LoadImageFile(itGIF,'tank.gif',image1,0);
LoadImageFile(itGif,'tankwar.gif',wimage1,0);
LoadImageFile(itGif,'bum.gif',bum,0);
LoadImageFile(itGif,'win.gif',wins,0);
LoadImageFile(itGif,'wars.gif',wars,0);
sound.load_music('p.wav',1);
randomize;
bar(0,0,getmaxx,getmaxy,rgbcolorrgb(24,146,91));
delay(1);
CHsys^.outtext(10,30,'press any key...',rgbcolorrgb(255,255,255));
readkey;
bar(0,0,getmaxx,getmaxy,rgbcolorrgb(24,146,91));
p:=cloneimage(image1);
wp:=CloneImage(wimage1);
x:=100; y:=100;
wx:=900; wy:=600;
life1:=100;
life2:=100;
image2:=rotateimage(CopyImage(p,image1),image1,20,25,20,25,41,47,w);
PutimageC(x,y,image2);
{player2}
ww:=0;
wimage2:=rotateimage(CopyImage(wp,wimage1),wimage1,20,25,20,25,41,47,ww);
PutimageC(wx,wy,wimage2);
Win:=false;
repeat
v:=random(60000);
{室 Їа®вЁўЁЄ }
case v of
1..10: begin {а §ў®а®в }
ww:=ww+$500;
bar(wx-10,wy-10,wx+50,wy+60,rgbcolorrgb(24,146,91));
wimage2:=rotateimage(CopyImage(wp,wimage1),wimage1,20,25,20,25,41,47,ww);
PutimageC(wx,wy,wimage2);
end;
11..20: begin
ww:=ww-$500;
bar(wx-10,wy-10,wx+50,wy+60,rgbcolorrgb(24,146,91));
wimage2:=rotateimage(CopyImage(wp,wimage1),wimage1,20,25,20,25,41,47,ww);
PutimageC(wx,wy,wimage2);
end;
21..30: begin {¤ўЁЈ вмбп}
bar(wx-10,wy-10,wx+50,wy+60,rgbcolorrgb(24,146,91));
If (round((wx-2*sin((ww/181)*pi/180)))>20) and (round((wx-4*sin((ww/181)*pi/180)))<getmaxx-40)
and (round((wy-2*cos((ww/181)*pi/180)))>20) and (round((wy-4*cos((ww/181)*pi/180)))<getmaxy-40) then
begin
wx:=round((wx-2*sin((ww/181)*pi/180)));
wy:=round((wy-2*cos((ww/181)*pi/180)));
end else
begin
if random(3)=1 then ww:=ww+3*$500 else ww:=ww-3*$500;
bar(wx-10,wy-10,wx+50,wy+60,rgbcolorrgb(24,146,91));
end;
wimage2:=rotateimage(CopyImage(wp,wimage1),wimage1,20,25,20,25,41,47,ww);
PutimageC(wx,wy,wimage2);
end;
31:begin
If Random(20)=1 then
begin
sound.play_music(1);
If wy-y<>0 then ww:=round(arctan((wx-x)/(wy-y))*181*190/pi);
if (rp2.len=0) or (rp2.len>100) then
begin
bar(rp2.x,rp2.y,rp2.x+10,rp2.y+10,rgbcolorrgb(24,146,91));
rp2.len:=1;
rp2.x:=round(wx+20-50*sin((ww/181)*pi/180));
rp2.y:=round(wy+25-50*cos((ww/181)*pi/180));
rp2.w:=ww
end
end
end; {fire}
end;
If (rp1.len<>0) and (random(2000)=34) then
begin
bar(rp1.x,rp1.y,rp1.x+10,rp1.y+10,rgbcolorrgb(24,146,91));
Inc(rp1.len,1);
If rp1.len=1000 then rp1.len:=0;
rp1.x:=round(rp1.x-6*sin((rp1.w/181)*pi/180));
rp1.y:=round(rp1.y-6*cos((rp1.w/181)*pi/180));
if rp1.len<>0 then PutImageC(rp1.x,rp1.y,bum);
If (rp1.x>wx+10) and (rp1.x<wx+31) and (rp1.y>wy+10) and (rp1.y<wy+33) then p1:=true;
end;
{---}
If (rp2.len<>0) and (random(2000)=34) then
begin
bar(rp2.x,rp2.y,rp2.x+10,rp2.y+10,rgbcolorrgb(24,146,91));
Inc(rp2.len,1);
If rp2.len=1000 then rp2.len:=0;
rp2.x:=round(rp2.x-6*sin((rp2.w/181)*pi/180));
rp2.y:=round(rp2.y-6*cos((rp2.w/181)*pi/180));
if rp2.len<>0 then PutImageC(rp2.x,rp2.y,bum);
If (rp2.x>x) and (rp2.x<x+41) and (rp2.y>y) and (rp2.y<y+47) then p2:=true;
end;
if keypressed then
begin
c:=ord(readkey);
If c=0 then begin c:=ord(readkey); rk:=true end else rk:=false;
case c of
32:begin
sound.play_music(1);
bar(rp1.x,rp1.y,rp1.x+10,rp1.y+10,rgbcolorrgb(24,146,91));
rp1.len:=1;
rp1.x:=round(x+20-50*sin((w/181)*pi/180));
rp1.y:=round(y+25-50*cos((w/181)*pi/180));
rp1.w:=w
end;
75:begin
bar(x-10,y-10,x+50,y+60,rgbcolorrgb(24,146,91));
w:=w+$500;
image2:=rotateimage(CopyImage(p,image1),image1,20,25,20,25,41,47,w);
If w=65280 then w:=0;
PutimageC(x,y,image2);
{--}
{ CHsys^.outtext(0,10,s,rgbcolorrgb(255,255,255));}
end;
77:begin
bar(x-10,y-10,x+50,y+60,rgbcolorrgb(24,146,91));
w:=w-$500;
image2:=rotateimage(CopyImage(p,image1),image1,20,25,20,25,41,47,w);
If w=-65280 then w:=0;
PutimageC(x,y,image2);
end;
72:begin {run}
bar(x-10,y-10,x+50,y+60,rgbcolorrgb(24,146,91));
If (round((x-4*sin((w/181)*pi/180)))>20) and (round((x-4*sin((w/181)*pi/180)))<getmaxx-40)
and (round((wy-4*cos((ww/181)*pi/180)))>20) and (round((wy-4*cos((ww/181)*pi/180)))<getmaxy-40) then
begin
x:=round((x-6*sin((w/181)*pi/180)));
y:=round((y-6*cos((w/181)*pi/180)));
end;
image2:=rotateimage(CopyImage(p,image1),image1,20,25,20,25,41,47,w);
PutimageC(x,y,image2);
end;
80:begin
bar(x-10,y-10,x+50,y+60,rgbcolorrgb(24,146,91));
x:=round((x+sin((w/181)*pi/180)));
y:=round((y+cos((w/181)*pi/180)));
image2:=rotateimage(CopyImage(p,image1),image1,20,25,20,25,41,47,w);
PutimageC(x,y,image2);
end
end
end; {if keeypressed}
If p1 or p2 then win:=true;
until (c=27) or (Win);
If p1 then
begin
PutImageC(GetMaxX div 2 -150,GetmaxY div 2 -50,Wins);
delay(1000);
readkey
end else
begin
PutImageC(GetMaxX div 2 -150,GetmaxY div 2 -50,Wars);
delay(1000);
readkey
end;
end.
Это просто код, но со скролом..
кстати, вопрос на засыпку -
какой компилятор надо использовать что -бы скопилировать этот код?