Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var x, x1, y, y1, button : int
- const keyleft := chr (203)
- const keyright := chr (205)
- const keydown := chr (208)
- const keyup := chr (200)
- const inc := 5
- const radius := 25
- var chars : string (1)
- 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)
- getch (chars)
- drawoval (x, y, radius, radius, white)
- if chars = keyleft then
- x := x - inc
- if x < radius then
- x := radius
- end if
- elsif chars = keyright then
- x := x + inc
- if x > maxx - radius then
- x := maxx - radius
- end if
- elsif chars = keydown then
- y := y - inc
- if y < radius then
- y := radius
- end if
- elsif chars = keyup 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