Skip to content

Instantly share code, notes, and snippets.

@villares
Last active April 28, 2017 17:03
Show Gist options
  • Save villares/dbb8c269671b56cb4f65f1a8834df5c0 to your computer and use it in GitHub Desktop.
Save villares/dbb8c269671b56cb4f65f1a8834df5c0 to your computer and use it in GitHub Desktop.
OO with bandeirinhas 2/7
def setup():
""" This code is called once by Processing """
global x, y
size(100, 100) # Canvas size
x, y = width / 2, height / 2 # Middle of the canvas
def draw():
""" The 'main loop' invoked by Processing """
global x, y
background(0) # Cleans the canvas, with black
bandeirinha(x, y) # Draws a small flag
x += 1 # increments x
y += 1 # increments y
if x > width + 25:
x = -25
if y > height + 25:
y = -25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment