const SPACE_BAR : char:=chr(32)
var wer:int:=0
var k : array char of boolean
var name:string
var v:int:=10
var u:int:=500
var w:int:=250
var tel:int:=0
var c:int:=100
const UP_ARROW := chr (200)
const ENTER := chr (10)
var l:int:=0
var d:int:=0
procedure check
colorback(black)
color(white)
if v<60 then
if u<60 and u>0 then
cls
colorback(white)
color(black)
drawfill(1,1,white,red)
put"game over"
put"your score was ",l
loop
end loop
end if
end if
end check
procedure check2
colorback(black)
color(white)
if v>60 then
if w<60 and w>0 then
cls
colorback(white)
color(black)
drawfill(1,1,white,red)
put"game over"
put"your score was ",l
loop
end loop
end if
end if
if v<60 then
if u<60 and u>0 then
cls
colorback(white)
color(black)
drawfill(1,1,white,red)
put"game over"
put"your score was ",l
loop
end loop
end if
end if
end check2
procedure CentreText (s : string, row : int)
locate (row, (maxcol - length (s)) div 2)
put s
View.Update
end CentreText
var s:int
procedure CentreFont (s : string, x, y, f, clr : int)
var w : int := Font.Width (s, f)
Font.Draw (s, x - w div 2, y, f, clr)
end CentreFont
var displayFont : int := Font.New ("Sanserif:14:bold")
var announceFont : int := Font.New ("Sanserif:72:bold")
CentreText ("Instructions", maxrow div 2 - 7)
CentreText ("Use the up arrow key to jump", maxrow div 2 - 5)
CentreText ("avoid the grey boxes for as long as possible", maxrow div 2 - 4)
CentreText ("Number in upper-left corner is the score",
maxrow div 2 - 2)
CentreText ("please wait", maxrow div 2)
delay(5000)
put"skip level"
get s
cls
if s=208 then
elsif s=304 then
else
CentreFont ("jump: level 1", maxx div 2, maxy div 2, announceFont, brightred)
delay(1000)
cls
loop
loop
loop
delay(c)
cls
check
put l
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(u,10,u+40,50,grey)
Input.KeyDown(k)
if k(UP_ARROW) then
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v+10
u:=u-10
check
exit when v=110
end loop
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v-10
u:=u-10
check
exit when v=10
end loop
end if
u:=u-10
exit when u<0
end loop
u:=500
l:=l+1
if c>10 then
c:=c-5
else
c:=c+95
end if
exit when l=5
end loop
CentreFont ("bonus level", maxx div 2, maxy div 2, announceFont, brightred)
delay(1000)
cls
var po:int:=0
u:=250
loop
loop
delay(c)
cls
check
put l
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(u,10,u+40,50,grey)
Input.KeyDown(k)
if k(ENTER)then
d:=d+1
elsif k(UP_ARROW) then
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v+10
u:=u-10
check
exit when v=110
end loop
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
v:=v-10
u:=u-10
check
exit when v=10
end loop
end if
u:=u-10
exit when u<0
end loop
u:=+po+250
po:=po+10
l:=l+1
if c>10 then
c:=c-5
else
c:=c+95
end if
exit when l=10
end loop
exit when l>14
end loop
end if
if s=304 then
else
CentreFont ("jump : level 2", maxx div 2, maxy div 2, announceFont, brightred)
delay(1000)
loop
loop
loop
delay(c)
cls
check2
put l," (pasword is 208)"
drawfillbox(w,90,w+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(u,10,u+40,50,grey)
Input.KeyDown(k)
if k(UP_ARROW) then
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(w,90,w+40,50,grey)
v:=v+10
w:=w-10
u:=u-10
check2
exit when v=110
end loop
loop
delay(c)
cls
put l
drawfillbox(u,10,u+40,50,grey)
drawfillbox(10,v,50,v+40,brightred)
drawfillbox(w,90,w+40,50,grey)
v:=v-10
u:=u-10
w:=w-10
check2
exit when v=10
end loop
end if
u:=u-10
w:=w-10
exit when u<0
if w=0 then
l:=l+1
end if
end loop
u:=500
w:=250
l:=l+1
if c>10 then
c:=c-5
else
c:=c+95
end if
end loop
end loop
end if
|