setscreen ("graphics")
var chars : array char of boolean
var x, y, a, b, count, c : int
count := 15
x := maxx div 2
y := maxy div 2
procedure box
randint (a, 20, maxx - 20)
randint (b, 20, maxy - 20)
drawfillbox (a, b, a + 20, b + 20, green)
end box
loop
drawfillbox (0, 0, maxx, maxy, black)
box
loop
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
y += 10
elsif chars (KEY_DOWN_ARROW) then
y -= 10
elsif chars (KEY_LEFT_ARROW) then
x -= 10
elsif chars (KEY_RIGHT_ARROW) then
x += 10
end if
if x > a and x < a + 20 and y > b and y < b + 20 then
drawfillbox (a, b, a + 20, b + 20, white)
count += 10
exit
end if
randint (c, 0, 50)
drawfilloval (x, y, 5, 5, c)
drawfillbox (a, b, a + 20, b + 20, green)
drawfilloval (x, y + count, 10, 10, black)
drawfilloval (x, y - count, 10, 10, black)
drawfilloval (x + count, y, 10, 10, black)
drawfilloval (x - count, y, 10, 10, black)
delay (20)
end loop
end loop
|