var chars : array char of boolean
var x : int := 0
var y : real := 0
proc jump
for angle : 0 .. 180 by 5
Input.KeyDown (chars)
if chars (KEY_RIGHT_ARROW) then
x += 2
end if
if chars (KEY_LEFT_ARROW) then
x -= 2
end if
y := 0
y += 90 * sind (angle)
drawfilloval (x, round (y), 5, 5, red)
View.Update
delay (25)
drawfilloval (x, round (y), 5, 5, colorbg)
end for
end jump
loop
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
jump
end if
if chars (KEY_RIGHT_ARROW) then
x += 2
end if
if chars (KEY_LEFT_ARROW) then
x -= 2
end if
drawfilloval (x, round (y), 5, 5, red)
View.Update
delay (10)
drawfilloval (x, round (y), 5, 5, colorbg)
end loop
|