Skip to content

Instantly share code, notes, and snippets.

@dotcomboom
Created May 4, 2020 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotcomboom/6cd8f1820af3782dd21fee1c213a443c to your computer and use it in GitHub Desktop.
Save dotcomboom/6cd8f1820af3782dd21fee1c213a443c to your computer and use it in GitHub Desktop.
import simplegui
c1x = 0
c2x = 0
p1x = 0
p2x = 0
p3x = 0
def draw_handler(canvas):
global c1x, c2x, p1x, p2x, p3x
c1x += 1
c2x += 2
p1x += 3
p2x += 4
p3x += 5
canvas.draw_circle((c1x,50), 50, 1, "Yellow", "Orange")
canvas.draw_circle((c2x,100), 25, 1, "Blue", "Aqua")
canvas.draw_line((p1x,125), (0,0), 5, "White")
canvas.draw_line((p2x,125), (0,0), 5, "Red")
canvas.draw_line((p3x,125), (0,0), 5, "Blue")
if c1x > 600:
c1x = 0
if c2x > 600:
c2x = 0
if p1x > 600:
p1x = 0
if p2x > 600:
p2x = 0
if p3x > 600:
p3x = 0
frame = simplegui.create_frame('Testing', 600, 600)
frame.set_canvas_background("Black")
frame.set_draw_handler(draw_handler)
frame.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment