%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Program name: protector astronut
% Author :Nima.A
% Teacher:Mr Noman(peace a shit)
% Date:Feb.25,2003
% Purpose :2D Shooting game
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var bfont : int := Font.New ("System:12")
View.Set ("offscreenonly")
randomize;
var brspeed, blspeed, brnumber : int := 1
procedure button (x1, y1, x2, y2, c, tc : int, s : string, md : boolean)
if md then
drawline (x1, y1, x2, y1, 30)
drawline (x2, y1, x2, y2, 30)
drawline (x2, y2, x1, y2, 25)
drawline (x1, y2, x1, y1, 25)
drawfillbox (x1 + 1, y1 + 1, x2 - 1, y2 - 1, c)
else
drawline (x1, y1, x2, y1, 25)
drawline (x2, y1, x2, y2, 25)
drawline (x2, y2, x1, y2, 30)
drawline (x1, y2, x1, y1, 30)
drawfillbox (x1 + 1, y1 + 1, x2 - 1, y2 - 1, c)
end if
Font.Draw (s, (x1 + ((x2 - x1) div 2)) - (Font.Width (s, bfont) div 2), (y1 + ((y2 - y1) div 2)) - 4, bfont, tc)
end button
procedure button2 (x1, y1, x2, y2, c, tc : int, s : string, md : boolean)
if md then
drawline (x1, y1, x2, y1, 30)
drawline (x2, y1, x2, y2, 30)
drawline (x2, y2, x1, y2, 25)
drawline (x1, y2, x1, y1, 25)
else
drawline (x1, y1, x2, y1, 25)
drawline (x2, y1, x2, y2, 25)
drawline (x2, y2, x1, y2, 30)
drawline (x1, y2, x1, y1, 30)
end if
Font.Draw (s, (x1 + ((x2 - x1) div 2)) - (Font.Width (s, bfont) div 2), (y1 + ((y2 - y1) div 2)) - 4, bfont, tc)
end button2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure menu (num, x1, x2, y1, ksp, dsp, c1, c2 : int, s : array 1 .. 100 of string, n : int)
var ii : int := num
for i : 1 .. num * 10 by 10
if (i div 10) not= n then
button (x1, (y1 + (dsp * (i div 10))) + i, x2, y1 + ((dsp * (i div 10)) + i) + ksp, c1, 7, s (ii), false)
else
button (x1, (y1 + (dsp * (i div 10))) + i, x2, y1 + ((dsp * (i div 10)) + i) + ksp, c2, 14, s (ii), true)
end if
ii := ii - 1
end for
end menu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure window (x1, y1, x2, y2, c1, c2 : int, s : string)
button2 (x1, y1, x2, y2, 8, 14, "", false)
button (x1 + 4, y2 - 5, x2 - 3, y2 - 20, c1, c2, s, true)
end window
procedure recscore (name : string, k, m, s, l : int)
var file : int
var t : string
open : file, "c:/score.txt", write
t := name + " " + intstr (k) + " " + intstr (m) + " " + intstr (s) + " " + intstr (l)
write : file, t
close (file)
end recscore
procedure showscore
var file : int
var t : string
open : file, "c:/score.txt", read
if file not= -10 then
loop
exit when eof (file)
read : file, t
put t
end loop
close (file)
else
cls
put "No score has been Recorded!!!!"
delay (1000)
close (file)
end if
end showscore
procedure gameoptions (var brspeed, blspeed, brnumber : int)
colorback (7)
color (15)
cls
locate (5, 20)
put "Speed Of The Space Rocks : "
locate (6, 20)
put "Rocks Released At Once : "
locate (7, 20)
put "Bullet Speed : "
color (29)
locate (5, 50)
get brspeed
locate (6, 50)
get brnumber
locate (7, 50)
get blspeed
end gameoptions
type joint :
record
x, y : int
end record
type joint2 :
record
x, y, r : int
d, ex : boolean
end record
procedure assign (var j : joint, x, y : int)
j.x := x
j.y := y
end assign
function rectcontact (x, y, x1, y1, x2, y2 : int) : boolean
for i : x1 .. x2
for j : y1 .. y2
if x = i then
if y = j then
result true
end if
end if
end for
end for
result false
end rectcontact
var bird, explosion : array 1 .. 10 of joint2
var pchar : array 1 .. 11 of joint
% s1 chest
const chest := 1
% s2 penis
const groin := 2
% s3 relbow
const relbow := 3
% s4 rhandp
const rhand := 4
% s5 lelbow
const lelbow := 5
% s6 lhand
const lhand := 6
% s7 rknee
const rknee := 7
% s8 rfoot
const rfoot := 8
% s9 lknee
const lknee := 9
% s10 lfoot
const lfoot := 10
% s11 head
const head := 11
const blhand := 2
const bhead := 1
var hight := 200
procedure jspeed (var s : real, i, ii : int)
var x, y : real
%s := sqrt ((i ** 2) - (ii ** 2))
s := ((- ((ii / 10) ** 2)) + 100)
end jspeed
pchar (head).x := 20
pchar (head).y := hight + 60
pchar (chest).x := 20
pchar (chest).y := hight + 50
pchar (groin).x := 20
pchar (groin).y := hight + 20
pchar (relbow).x := 30
pchar (relbow).y := hight + 40
pchar (rhand).x := 40
pchar (rhand).y := hight + 50
pchar (lelbow).x := 10
pchar (lelbow).y := hight + 40
pchar (lhand).x := 20
pchar (lhand).y := hight + 30
pchar (rknee).x := 30
pchar (rknee).y := hight + 10
pchar (rfoot).x := 20
pchar (rfoot).y := hight
pchar (lknee).x := 10
pchar (lknee).y := hight + 10
pchar (lfoot).x := 0
pchar (lfoot).y := hight + 00
procedure cursor (xx, yy : int)
drawline (xx - 4, yy, xx + 4, yy, 15)
drawline (xx, yy - 4, xx, yy + 4, 15)
end cursor
colorback (7)
cls
procedure drawch (pchar : array 1 .. 11 of joint, x, y : int)
drawfilloval (pchar (head).x + x, pchar (head).y + y, 10, 10, 1)
drawline (pchar (head).x + x, pchar (head).y + y, pchar (chest).x + x, pchar (chest).y + y, 9)
drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (groin).x + x, pchar (groin).y + y, 12)
drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (relbow).x + x, pchar (relbow).y + y, 10)
drawline (pchar (relbow).x + x, pchar (relbow).y + y, pchar (rhand).x + x, pchar (rhand).y + y, 10)
drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (lelbow).x + x, pchar (lelbow).y + y, 10)
drawline (pchar (lelbow).x + x, pchar (lelbow).y + y, pchar (lhand).x + x, pchar (lhand).y + y, 10)
drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (rknee).x + x, pchar (rknee).y + y, 10)
drawline (pchar (rknee).x + x, pchar (rknee).y + y, pchar (rfoot).x + x, pchar (rfoot).y + y, 10)
drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (lknee).x + x, pchar (lknee).y + y, 10)
drawline (pchar (lknee).x + x, pchar (lknee).y + y, pchar (lfoot).x + x, pchar (lfoot).y + y, 10)
View.Update
end drawch
procedure cleanch (pchar : array 1 .. 11 of joint, x, y : int)
drawfilloval (pchar (head).x + x, pchar (head).y + y, 10, 10, 7)
drawline (pchar (head).x + x, pchar (head).y + y, pchar (chest).x + x, pchar (chest).y + y, 7)
drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (groin).x + x, pchar (groin).y + y, 7)
drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (relbow).x + x, pchar (relbow).y + y, 7)
drawline (pchar (relbow).x + x, pchar (relbow).y + y, pchar (rhand).x + x, pchar (rhand).y + y, 7)
drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (lelbow).x + x, pchar (lelbow).y + y, 7)
drawline (pchar (lelbow).x + x, pchar (lelbow).y + y, pchar (lhand).x + x, pchar (lhand).y + y, 7)
drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (rknee).x + x, pchar (rknee).y + y, 7)
drawline (pchar (rknee).x + x, pchar (rknee).y + y, pchar (rfoot).x + x, pchar (rfoot).y + y, 7)
drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (lknee).x + x, pchar (lknee).y + y, 7)
drawline (pchar (lknee).x + x, pchar (lknee).y + y, pchar (lfoot).x + x, pchar (lfoot).y + y, 7)
View.Update
end cleanch
var x1, x2, x3, x4, y1, y2, y3, y4 : int
x1 := 30
x2 := 10
x3 := 20
x4 := 0
procedure walkch (var pchar : array 1 .. 11 of joint, i : int)
if x1 not= pchar (groin).x - 10 then
x1 := x1 - 1
end if
if x2 not= pchar (groin).x + 10 then
x2 := x2 + 1
end if
if x3 not= pchar (groin).x - 20 then
x3 := x3 - 1
end if
if x4 not= pchar (groin).x then
x4 := x4 + 1
end if
if i = 20 then
pchar (rknee).x := 30
pchar (rfoot).x := 10
pchar (lknee).x := 20
pchar (lfoot).x := 0
x1 := 30
x2 := 10
x3 := 20
x4 := 0
end if
assign (pchar (rknee), x1, pchar (groin).y - 10)
assign (pchar (lknee), x2, pchar (groin).y - 10)
assign (pchar (rfoot), x3, pchar (groin).y - 20)
assign (pchar (lfoot), x4, pchar (groin).y - 20)
end walkch
procedure counter (var i : int, m, b : int)
if i not= m then
i := i + b
else
i := 1
end if
end counter
var ww, misses : int := 0
var y : real := 0
var bfire : array 1 .. 10 of boolean
var bjump : boolean := false
var bullet : array 1 .. 10 of joint
var i := 0
var xx, yy := 10
var ch : char
var fff := 1
var jjj := -100
for ii : 1 .. 10
bullet (ii).x := 1
bullet (ii).y := 300
end for
for ii : 1 .. 10
bfire (ii) := false
end for
procedure pbullet (var bullet : array 1 .. 10 of joint, xxx : int)
if bullet (xxx).x <= 600 then
bullet (xxx).x := bullet (xxx).x + blspeed
else
bfire (xxx) := false
end if
end pbullet
procedure drawbullet (var bullet : joint, var bfire : array 1 .. 10 of boolean, ii : int)
drawfilloval (bullet.x, bullet.y, 6, 2, 8)
View.Update
end drawbullet
procedure cleanbullet (var bullet : joint, var bfire : array 1 .. 10 of boolean, ii : int)
drawfilloval (bullet.x, bullet.y, 6, 2, 7)
View.Update
end cleanbullet
procedure line (x1, y1, x2, y2 : int, x : real, var y : int)
var m : real
if x2 not= x1 then
m := ((y2 - y1) / (x2 - x1))
end if
y := round (m * x)
end line
for kj : 1 .. 10
bird (kj).x := 490 + (kj * 10)
bird (kj).y := 100 + (kj * 20)
bird (kj).d := false
bird (kj).ex := false
bird (kj).r := 0
explosion (kj).x := 490 + (kj * 10)
explosion (kj).y := 100 + (kj * 20)
explosion (kj).d := false
explosion (kj).ex := false
end for
procedure birdmove (var bird : joint2, pchar : array 1 .. 11 of joint, var x : real, xx, yy : int)
if bird.d then
var x2 := pchar (head).x + xx
var y2 := pchar (head).y + yy
if bird.x > 0 then
bird.x := bird.x - brspeed
end if
if bird.x <= 1 then
misses := misses + 1
bird.ex := true
bird.d := false
end if
if bird.y > y2 then
bird.y := round (bird.y - 1)
end if
if bird.y < bird.r then
bird.y := round (bird.y + .5)
end if
end if
end birdmove
procedure drawbird (bird : joint2)
var i1, i2, i3, i4, i5 : int
var r1, r2, r3, r4 : int
if bird.d then
randint (r1, 1, 5)
randint (r2, 1, 5)
randint (r3, 1, 5)
randint (r4, 1, 5)
randint (i1, 1, 255)
randint (i2, 1, 255)
randint (i3, 1, 255)
randint (i4, 1, 255)
randint (i5, 1, 255)
drawfilloval (bird.x, bird.y, 10, 10, i1)
drawfilloval (bird.x - 5, bird.y, r1, r4, i2)
drawfilloval (bird.x + 5, bird.y, r2, r3, i3)
drawfilloval (bird.x, bird.y - 5, r3, r2, i4)
drawfilloval (bird.x, bird.y + 5, r4, r1, i5)
drawline (bird.x, bird.y - 10, bird.x, bird.y + 10, i1)
drawline (bird.x - 10, bird.y, bird.x + 10, bird.y, i1)
View.Update
end if
end drawbird
procedure cleanbird (bird : joint2)
if bird.d then
drawfilloval (bird.x, bird.y, 11, 11, 7)
end if
View.Update
end cleanbird
procedure drawex (var bird : joint2, x, y, i : int)
drawoval (x, y, i, i, i)
drawoval (x, y, 10 - i, i, i)
drawoval (x, y, i, 10 - i, i)
if i = 20 then
drawfilloval (x, y, i, i, 16)
bird.ex := false
end if
View.Update
end drawex
procedure createn (var bird : array 1 .. 10 of joint2, h : int)
var hh, x, y : int := 0
var b : boolean := false
for i : 1 .. 10
if bird (i).d then
hh := hh + 1
end if
end for
if hh < h then
for i : 1 .. 10
if not bird (i).d then
bird (i).d := true
randint (x, 1, 100)
randint (y, 1, 160)
bird (i).x := 400 + x
bird (i).y := 260 + y
randint (bird (i).r, 0, 400)
exit
end if
end for
end if
View.Update
end createn
procedure background (x1, y1 : int)
drawfillstar (x1 + 220, y1 + 170, x1 + 230, 180 + y1, 8)
drawfillstar (x1 + 390, y1 + 200, x1 + 400, 210 + y1, 8)
drawfillstar (x1 + 430, y1 + 260, x1 + 440, 270 + y1, 8)
drawfillstar (x1 + 520, y1 + 150, x1 + 530, 140 + y1, 8)
drawfillstar (x1 + 360, y1 + 130, x1 + 350, 140 + y1, 8)
drawfillstar (x1 + 90, y1 + 120, x1 + 80, 110 + y1, 8)
drawfillstar (x1 + 80, y1 + 270, x1 + 90, 280 + y1, 8)
drawfillstar (x1 + 240, y1 + 290, x1 + 250, 300 + y1, 8)
drawfillstar (x1 + 470, y1 + 350, x1 + 480, 340 + y1, 8)
drawfillstar (x1 + 560, y1 + 300, x1 + 570, 290 + y1, 8)
drawfillstar (x1 + 290, y1 + 240, x1 + 300, 230 + y1, 8)
drawfillstar (x1 + 130, y1 + 380, x1 + 140, 370 + y1, 8)
drawfillstar (x1 + 140, y1 + 90, x1 + 150, 80 + y1, 8)
drawfillstar (x1 + 420, y1 + 70, x1 + 430, 60 + y1, 8)
drawfillstar (x1 + 610, y1 + 40, x1 + 620, 30 + y1, 8)
drawfillstar (x1 + 340, y1 + 30, x1 + 320, 50 + y1, 11)
drawfillstar (x1 + 30, y1 + 190, x1 + 50, 210 + y1, 11)
drawfillstar (x1 + 540, y1 + 210, x1 + 560, 240 + y1, 11)
drawfillstar (x1 + 570, y1 + 330, x1 + 590, 350 + y1, 11)
drawfillstar (x1 + 380, y1 + 350, x1 + 360, 370 + y1, 11)
drawfillstar (x1 + 310, y1 + 140, x1 + 280, 170 + y1, 11)
drawfillstar (x1 + 180, y1 + 230, x1 + 160, 250 + y1, 11)
drawfillstar (x1 + 70, y1 + 330, x1 + 90, 310 + y1, 11)
drawfillstar (x1 + 330, y1 + 310, x1 + 310, 330 + y1, 11)
drawfillstar (x1 + 510, y1 + 60, x1 + 540, 40 + y1, 11)
View.Update
end background
var bbi := .1
var brx, bry := 200
var mmm, num, menunum := 1
var back, bmissed : boolean := false
var bx1, bx2, by1, by2 : real := 0
bird (1).d := true
var yy2, shots, kills, missed := 0
var name : string
var level := 1
var menus : array 1 .. 100 of string
menus (1) := "Start Game"
menus (2) := "Game Options"
menus (3) := "Game Rulez"
menus (4) := "Show last Scores"
menus (5) := "Exit"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure startgame
color (7)
locate (4, 10)
put "Please enter your name : "
locate (4, 35)
get name
colorback (7)
loop
createn (bird, brnumber)
% LOCATING SECTION LOCATING SECTION LOCATING SECTION LOCATING SECTION
for ii : 1 .. 10
if bfire (ii) then
pbullet (bullet, ii)
end if
end for
if bjump then
jspeed (y, 100, jjj)
counter (jjj, 100, 3)
if back then
xx := xx - 1
else
xx := xx + 1
end if
if jjj >= 100 then
bjump := false
jjj := -100
end if
end if
color (15)
for ii : 1 .. 10
if bird (ii).d then
birdmove (bird (ii), pchar, bbi, xx, round (y))
end if
end for
bbi := bbi + 1
% DRAWING SECTION DRAWING SECTION DRAWING SECTION DRAWING SECTION
for jj : 1 .. 10
if bfire (jj) then
for ii : 1 .. 10
if bird (ii).d then
if rectcontact (bullet (jj).x, bullet (jj).y, bird (ii).x - 10, bird (ii).y - 10, bird (ii).x + 10, bird (ii).y + 10) then
if (kills + 1) mod 50 = 0 then
locate (6, 35)
put "You have advanced to the next level !!!!!"
locate (6, 35)
brspeed := brspeed + 1
brnumber := brnumber + 1
put " Press any key to continue . . . . "
loop
exit when hasch
end loop
end if
kills := kills + 1
bfire (jj) := false
bird (ii).d := false
bird (ii).ex := true
end if
end if
end for
end if
end for
for ii : 1 .. 10
if bird (ii).ex then
explosion (ii).d := true
explosion (ii).ex := true
explosion (ii).x := bird (ii).x
explosion (ii).y := bird (ii).y
bird (ii).ex := false
end if
end for
for ii : 1 .. 10
if explosion (ii).ex then
counter (mmm, 20, 1)
drawex (explosion (ii), explosion (ii).x, explosion (ii).y, mmm)
end if
end for
for ii : 1 .. 10
if bfire (ii) then
drawbullet (bullet (ii), bfire, ii)
end if
end for
drawch (pchar, xx, round (y))
for ii : 1 .. 10
if bird (ii).d then
drawbird (bird (ii))
end if
end for
% CLEANING SECTION CLEANING SECTION CLEANING SECTION CLEANING SECTION
delay (20)
for ii : 1 .. 10
if bfire (ii) then
cleanbullet (bullet (ii), bfire, ii)
else
bullet (ii).x := xx
end if
end for
cleanch (pchar, xx, round (y))
for ii : 1 .. 10
if bird (ii).d then
cleanbird (bird (ii))
end if
end for
if hasch then
ch := getchar
case ch of
label "d" :
counter (ww, 20, 1)
back := false
if not bjump then
walkch (pchar, ww)
xx := xx + 3
else
xx := xx + 2
end if
label "a" :
counter (ww, 20, 1)
back := true
if not bjump then
walkch (pchar, ww)
xx := xx - 3
else
xx := xx - 2
end if
label "f" :
shots := shots + 1
bfire (fff) := true
bullet (fff).x := xx + 30
counter (fff, 9, 1)
bullet (fff).y := round (y) + pchar (head).y
label "w" :
bjump := true
label chr (27) :
colorback (8)
cls
window (100, 100, 530, 290, 9, 14, "Score")
button2 (105, 105, 525, 265, 8, 14, "", true)
color (7)
locate (10, 15)
put "Kills : ", kills
locate (11, 15)
put "misses : ", misses
locate (12, 15)
put "Shots : ", shots
locate (13, 15)
level := round ((brspeed * brnumber) / blspeed)
put "Level : ", level
recscore (name, kills, misses, shots, level)
window (100, 100, 530, 290, 9, 14, "Score")
button2 (105, 105, 525, 265, 8, 14, "", true)
loop
exit when hasch
end loop
exit
label chr (208) :
for ii : 1 .. 10
bird (ii).y := bird (ii).y + 3
bullet (ii).y := bullet (ii).y + 3
by1 := by1 + .1
end for
label chr (200) :
for ii : 1 .. 10
bird (ii).y := bird (ii).y - 3
bullet (ii).y := bullet (ii).y - 3
by1 := by1 - .1
end for
label :
end case
end if %Hasch
cls
background (round (bx1), round (by1))
background (round (bx1), round (by1) + 400)
background (round (bx1), round (by1) - 400)
end loop
end startgame
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%menu (num, x1, x2, y1, ksp, dsp, c1, c2 : int, s : array 1 .. 100 of string, n : int)
%menu (10, 220, 420, 10, 20, 20, 8, 1, menus, i)
procedure gamerules
color (7)
window (10, 10, 630, 390, 9, 14, "Game Rules")
locate (4, 4)
put "This a simple 2D shooting game. Your character is an astronut"
locate (5, 4)
put "who is equiped with a jetpack and a gun and he's trying to protect "
locate (6, 4)
put "his ship from flying aerolite by blowing them off the space."
locate (7, 4)
put "Controls :"
locate (8, 4)
put "d --> Walk forward"
locate (9, 4)
put "a --> Walk backward"
locate (10, 4)
put "w --> Jump"
locate (11, 4)
put "Up --> Move up"
locate (12, 4)
put "Down --> Move down"
locate (13, 4)
put "Esc --> Exit"
locate (17, 10)
put " Press anykey to return to main menu . . ."
window (10, 10, 630, 390, 9, 14, "Game Rules")
loop
exit when hasch
end loop
end gamerules
colorback (8)
cls
menunum := 4
window (200, 50, 440, 300, 9, 14, "Main Menu")
menu (5, 220, 420, 100, 20, 20, 8, 9, menus, menunum)
color (14)
loop
if hasch then
window (200, 50, 440, 300, 9, 14, "Main Menu")
case getchar of
label chr (200) :
if menunum < 4 then
menunum := menunum + 1
end if
label chr (208) :
if menunum > 0 then
menunum := menunum - 1
end if
label chr (10) :
put menunum
case menunum of
label 4 :
cls
startgame
colorback (8)
cls
window (200, 50, 440, 300, 9, 14, "Main Menu")
label 3 :
cls
gameoptions (brspeed, blspeed, brnumber)
colorback (8)
cls
window (200, 50, 440, 300, 9, 14, "Main Menu")
label 2 :
cls
gamerules
colorback (8)
cls
window (200, 50, 440, 300, 9, 14, "Main Menu")
label 1 :
colorback (7)
cls
showscore
put "press any key to continue..."
loop
exit when hasch
end loop
colorback (8)
cls
label 0 :
exit
label :
end case
label :
end case
menu (5, 220, 420, 100, 20, 20, 8, 9, menus, menunum)
end if
end loop
%gameoptions (brspeed, blspeed, brnumber) |