Skip to content

Instantly share code, notes, and snippets.

@dotcomboom
Created May 4, 2020
Embed
What would you like to do?
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