%Settings
setscreen ("graphics:830;600")
View.Set ("offscreenonly")
%Settings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Variables
var x, y, button : int %The User
var badx, bady, badx2, bady2, badx3, bady3, badx4, bady4, badx5, bady5, badx6, bady6, badx7, bady7 : int %Enemy
var chars : array char of boolean %To move box
var score : int := 60
var moneyx, moneyy : int
var money : int := 0
%Variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
x := 220
%y := 540
y := 200
drawfillbox (x, y, x + 50, y + 50, 12)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc drawmap
%Top
drawfillbox (0, 510, 830, 610, green)
%Top
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Top Road
drawfillbox (-10, 510, 830, 280, 7)
drawfillbox (10, 385, 150, 405, yellow)
drawfillbox (180, 385, 320, 405, yellow)
drawfillbox (350, 385, 490, 405, yellow)
drawfillbox (520, 385, 670, 405, yellow)
drawfillbox (700, 385, 830, 405, yellow)
%Top Road
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Middle
drawfillbox (-10, 280, 830, 240, 23)
%Middle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Bottom Road
drawfillbox (-10, 240, 830, 0, 7)
drawfillbox (10, 130, 150, 110, yellow)
drawfillbox (180, 130, 320, 110, yellow)
drawfillbox (350, 130, 490, 110, yellow)
drawfillbox (520, 130, 670, 110, yellow)
drawfillbox (700, 130, 830, 110, yellow)
%Bottom Road
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end drawmap
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc hey
%Random Spots For Boxes
randint (badx, -50, -50)
randint (bady, 5, 150)
randint (badx2, 820, 820)
randint (bady2, 5, 150)
randint (badx3, 820, 820)
randint (bady3, 280, 430)
randint (badx4, -50, -50)
randint (bady4, 280, 430)
randint (badx5, -50, -50)
randint (bady5, 5, 150)
randint (badx6, 820, 820)
randint (bady6, 280, 430)
randint (badx7, 820, 820)
randint (bady7, 280, 430)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
randint (moneyx, 100, 800)
randint (moneyy, 0, 570)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Random Spots For Boxes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
loop
drawmap
locate (1, 1)
put "Life: ", score
put "Cash: ", money
drawfillbox (90, 511, 830, 610, green)
drawfillbox (x, y, x + 50, y + 50, 12)
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
y := y + 4
end if
if chars (KEY_DOWN_ARROW) then
y := y - 4
end if
if chars (KEY_LEFT_ARROW) then
x := x - 4
end if
if chars (KEY_RIGHT_ARROW) then
x := x + 4
end if
if x < 0 then
x := x + 4
end if
if x > 778 then
x := x - 4
end if
if y < 1 then
y := y + 4
end if
if y > 547 then
y := y - 4
end if
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Boxes Moving
drawfillbox (badx, bady, badx + 80, bady + 80, 0)
delay (12)
badx := badx + 7
drawfillbox (badx2, bady2, badx2 + 80, bady2 + 80, 0)
delay (12)
badx2 := badx2 - 6
drawfillbox (badx3, bady3, badx3 + 80, bady3 + 80, 0)
delay (12)
badx3 := badx3 - 6
drawfillbox (badx4, bady4, badx4 + 80, bady4 + 80, 54)
delay (12)
badx4 := badx4 + 5
drawfillbox (badx5, bady5, badx5 + 80, bady5 + 80, 0)
delay (12)
badx5 := badx5 + 8
drawfillbox (badx6, bady6, badx6 + 80, bady6 + 80, 0)
delay (12)
badx6 := badx6 - 8
drawfillbox (badx7, bady7, badx7 + 80, bady7 + 80, 0)
delay (12)
badx7 := badx7 - 8
exit when badx > 880 or badx2 < -60 or badx3 < -60 and badx4 < 880
%Boxes Moving
if x <= badx + 70 and x + 50 >= badx then
if y <= bady + 70 and y + 50 >= bady then
score := score - 1
end if
end if
if x <= badx2 + 70 and x + 50 >= badx2 then
if y <= bady2 + 70 and y + 50 >= bady2 then
score := score - 1
end if
end if
if x <= badx3 + 70 and x + 50 >= badx3 then
if y <= bady3 + 70 and y + 50 >= bady3 then
score := score - 1
end if
end if
if x <= badx4 + 70 and x + 50 >= badx4 then
if y <= bady4 + 70 and y + 50 >= bady4 then
score := score - 1
end if
end if
if x <= badx5 + 70 and x + 50 >= badx5 then
if y <= bady5 + 70 and y + 50 >= bady5 then
score := score - 1
end if
end if
if x <= badx6 + 70 and x + 50 >= badx6 then
if y <= bady6 + 70 and y + 50 >= bady6 then
score := score - 1
end if
end if
if x <= badx7 + 70 and x + 50 >= badx7 then
if y <= bady7 + 70 and y + 50 >= bady7 then
score := score - 1
end if
end if
drawfillbox (moneyx, moneyy, moneyx + 20, moneyy + 20, 34)
if x <= moneyx + 20 and x + 50 >= moneyx and y <= moneyy + 20 and y + 20 >= moneyy then
money := money + 1
end if
View.Update
exit when score <= 0
exit when money >= 12
cls
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end hey
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
loop
exit when score <= 0
exit when money >= 12
hey
end loop
color (7)
put "You Lose!"
put ""
delay (1000)
put "Maybe next time!"
cls
|