setscreen ("graphics:300;250")
%Variables
var move : array char of boolean
var x, y, x2, y2, button, button2 : int %Snake
var foodx, foody : int %Food
var score : int := 0
var bulletx, bullety : int
%variables
bulletx := 100
bullety := 200
mousewhere (x, y, button)
process movement
x := 10
y := 10
drawfillbox (x, y, x + 10, y + 10, 7)
loop
Input.KeyDown (move)
if move (KEY_UP_ARROW) then
drawfillbox (x, y, x + 10, y + 10, 7)
delay (30)
drawfillbox (x, y, x + 10, y + 10, 0)
y := y + 4
end if
if move (KEY_DOWN_ARROW) then
drawfillbox (x, y, x + 10, y + 10, 7)
delay (30)
drawfillbox (x, y, x + 10, y + 10, 0)
y := y - 4
end if
if move (KEY_LEFT_ARROW) then
drawfillbox (x, y, x + 10, y + 10, 7)
delay (30)
drawfillbox (x, y, x + 10, y + 10, 0)
x := x - 4
end if
if move (KEY_RIGHT_ARROW) then
drawfillbox (x, y, x + 10, y + 10, 7)
delay (30)
drawfillbox (x, y, x + 10, y + 10, 0)
x := x + 4
elsif move (KEY_ENTER) then
mousewhere (x, x, x)
loop
drawfillbox (bulletx, bullety, bulletx + 20, bullety + 20, 7)
delay (30)
drawfillbox (bulletx, bullety, bulletx + 20, bullety + 20, 0)
bulletx := bulletx + 2
exit when bulletx > 200
end loop
else
drawfillbox (x, y, x + 10, y + 10, 7)
end if
if x < -5 then
break
end if
if x > 290 then
break
end if
if y < 0 then
break
end if
if y > 240 then
break
end if
if bulletx >= x2 and bulletx <= x2 + 20 and bullety >= y2 and bullety <= y2 + 20 then %%
break
end if
end loop
end movement
mousewhere (x2, y2, button2)
process movement1
x2 := 140
y2 := 200
drawfillbox (x2, y2, x2 + 10, y2 + 10, 7)
loop
Input.KeyDown (move)
if move ('w') then
drawfillbox (x2, y2, x2 + 10, y2 + 10, 7)
delay (30)
drawfillbox (x2, y2, x2 + 10, y2 + 10, 0)
y2 := y2 + 4
end if
if move ('s') then
drawfillbox (x2, y2, x2 + 10, y2 + 10, 7)
delay (30)
drawfillbox (x2, y2, x2 + 10, y2 + 10, 0)
y2 := y2 - 4
end if
if move ('a') then
drawfillbox (x2, y2, x2 + 10, y2 + 10, 7)
delay (30)
drawfillbox (x2, y2, x2 + 10, y2 + 10, 0)
x2 := x2 - 4
end if
if move ('d') then
drawfillbox (x2, y2, x2 + 10, y2 + 10, 7)
delay (30)
drawfillbox (x2, y2, x2 + 10, y2 + 10, 0)
x2 := x2 + 4
else
drawfillbox (x2, y2, x2 + 10, y2 + 10, 7)
end if
if x2 < -5 then
break
end if
if x2 > 290 then
break
end if
if y2 < 0 then
break
end if
if y2 > 240 then
break
end if
if bulletx >= x2 and bulletx <= x2 + 20 and bullety >= y2 and bullety <= y2 + 20 then %%
break
end if
end loop
end movement1
%Forks
fork movement
fork movement1
%Forks
|