var ballx, bally, rise, run, rad, u, yy, xx : int
ballx := maxx div 2
bally := maxy div 2
rad := 10
rise := 1
run := 3
View.Set ("offscreenonly")
loop
var x, y, button : int
Mouse.Where (x, y, button)
Draw.FillOval (ballx, bally, rad, rad, blue)
ballx := ballx + run
bally := bally + rise
if ballx > maxx or ballx < 0 then
run := run * -1
end if
if bally > maxy or bally < 0 then
rise := rise * -1
end if
View.Update
delay (10)
cls
drawfillbox (x - 50, 0, x + 50, 10, red)
if bally = 10 and ballx < x - 51 and ballx > x + 51 then
exit
end if
end loop
|