var x := 320
var gunx : int
var guny := 30
var chars : array char of boolean
process gun
loop
Draw.FillOval (gunx, guny, 5, 5, black)
delay (10)
Draw.FillOval (gunx, guny, 5, 5, white)
guny := guny + 1
exit when guny = 480
end loop
guny := 30
end gun
loop
Input.KeyDown (chars)
Draw.FillOval (x, 30, 10, 10, red)
delay (5)
Draw.FillOval (x, 30, 10, 10, white)
if chars (KEY_LEFT_ARROW) then
x := x - 1
if x <= 10 then
x := x + 1
end if
elsif chars (KEY_RIGHT_ARROW) then
x := x + 1
if x >= 625 then
x := x - 1
end if
elsif chars (KEY_CTRL) then
gunx := x
fork gun
end if
end loop
|