НЕИЗВЕСНОЕ ИМЯ 'Bullet' uses GraphABC; var s:array [,] of integer;...

0 голосов
95 просмотров

НЕИЗВЕСНОЕ ИМЯ 'Bullet'
uses GraphABC;
var s:array [,] of integer;
i,x,y,vspeed,x1,y1,x2,y2,n,k:integer;
game_end : boolean;

Procedure Keypress(key:char); begin
if (key='d') and (s[(x div 8)+1,(y div 8)]=0) then
x:=x+8;
if (key='a') and (s[(x div 8)-1,(y div 8)]=0) then
x:=x-8;
if (key='w') and (vspeed=0) and (s[(x div 8),(y div 8)+1]=1) then
vspeed:=-16;
if (key='f') then Bullet()
end;
procedure Keydown(key:integer); begin
if (key=vk_enter) then game_end:=true;
end;
Procedure Bullet();
Begin
Setbrushcolor(clyellow);
fillrectangle(x2,y2,x2+8,Y2+8);
X2:=X+8;
Y2:=472;
N:=Y2+8+Y2;
repeat;
n:=n-16;
until(N=8) or (x2=x1);
If not (N=8) or (x2=x1)
then begin
clearwindow;
Draw();
end;
If (N=8) and (x2=x1) then
begin
Clearwindow;
Draw();
inc(k);
writeln('Счёт:', k, 'Очко(а)(ов)');
end;
end;

procedure Gravity(); begin
if vspeed=0 then begin
if s[(x div 8),(y div 8)+vspeed]=0 then y+=vspeed;
if vspeed <>0 then
vspeed+=2;
end;
end;
Procedure Draw(); begin
Redraw;
Lockdrawing;
setbrushcolor(clwhite);
fillrectangle(0,0,640,480);

setbrushcolor(clred);
circle(x1,y1,24);
setbrushcolor(claqua);
fillrectangle(x,y,x+8,y+8);
end;


Begin
game_end:=False;
x:=Random(640);
y:=480;
x1:=Random(640);
y1:=0;
s:=new integer[200,200];
while game_end=false do begin
Draw();
Gravity();
Onkeypress:=Keypress;
Onkeydown:=Keydown;
sleep(30);
end;
end.


Как решить? Если поменять Bullet и Keypress пишет Нет перегруженной подпрограммы с таким количеством параметров Draw.


Информатика (15 баллов) | 95 просмотров
Дан 1 ответ
0 голосов
Правильный ответ

Сделайте начало таким:

uses GraphABC;
var s:array [,] of integer;
i,x,y,vspeed,x1,y1,x2,y2,n,k:integer;
game_end : boolean;

procedure Bullet; forward;

procedure Draw; forward;

Procedure Keypress(key:char); begin
if (key='d') and (s[(x div 8)+1,(y div 8)]=0) then

Кстати, замените цвет на setbrushcolor(clAquamarine);  - цвета claqua нет.



(150k баллов)
0

Спасибо^_^ Но теперь новая проблема.

0

Параметр цикла должен описыватся в заголовке цикла

0

Когда включаю программу, всё равно белый экран и ничего не помогает

0

Ну, там еще точку заметить можно