Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var x, x1, y, y1, button : int
- const radius := 25
- const inc := 5
- var chars : array char of boolean
- procedure keydown
- Input.KeyDown (chars)
- end keydown
- x := radius
- y := radius
- setscreen ("graphics800:800")
- loop
- Mouse.Where (x1, y1, button)
- drawoval (x, y, radius, radius, 1)
- if button = 1 then
- Mouse.Where (x, y, button)
- drawoval (x, y, radius, radius, 1)
- elsif button = 0 then
- drawoval (x, y, radius, radius, 1)
- keydown
- delay (10)
- drawoval (x, y, radius, radius, white)
- if chars (KEY_LEFT_ARROW) then
- x := x - inc
- if x < radius then
- x := radius
- end if
- end if
- if chars (KEY_RIGHT_ARROW) then
- x := x + inc
- if x > maxx - radius then
- x := maxx - radius
- end if
- end if
- if chars (KEY_DOWN_ARROW) then
- y := y - inc
- if y < radius then
- y := radius
- end if
- end if
- if chars (KEY_UP_ARROW) then
- y := y + inc
- if y > maxy - radius then
- y := maxy - radius
- end if
- end if
- %put ""
- end if
- end loop
Advertisement
Add Comment
Please, Sign In to add comment