Need Help for a Pod Racer Program - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need Help for a Pod Racer Program

war12321war12321 New JerseyPosts: 1Member

When I try to compile my program, the following error comes up. ((19,1) Error: Illegal expression, (19,11) Fatal: Syntax error, ";" expected but "identifier PLAYERMOVEMENT" found)


Program Final;

Uses crt;

Var movement:char;
level, x, y, z, score, rand:Integer;
Track:Array[1..10] of Integer;

Procedure field;
Begin

For z:= 1 to 15 do
Begin
rand:= random(3)-1;
Track[z]:= 20 + rand;

End;

Procedure Playermovement;
Begin

movemnt:=readkey;
case movement of
'j':Begin
gotoxy(x,15);
write('');
x:=x-1;
End;

'k':Begin
gotoxy(x,15);
write('');
x:=x+1;
End;

End;

Procedure layout;
begin

y:=9;
For z:= 1 to 15 do
Begin

y:=y + 1;
gotoxy(track[z, y);
writeln('');
gotoxy(track[z] + 20, y);
writeln('
');
End;
delay(100);

End;

Procedure Trackmovement;
Begin

For z:=15 downto 2 do
Begin

Track[z]:=Track[z-1];
rand:= random(3)-1;
Track[1]:=20 + rand;
End;

End;

Begin

cursoroff;
level:= 1;
points:= 0;
writeln('Welcome to Podracer 2014!');
readkey;
writeln('Would you like to start a new game? (y/n)');
readln;

writeln('Level: ', level);

delay(100);

track;
layout;
Playermovement;
repeat
Trackmovement;
clrscr;
layout;

gotoxy(25, 40);
score:=score+level;
write('Score: ', score);

level:=level+1;

until 1 = 2;
readkey;

End.

Can anyone help a lowly CompSci student?

Sign In or Register to comment.