Last active
April 28, 2017 17:03
-
-
Save villares/dbb8c269671b56cb4f65f1a8834df5c0 to your computer and use it in GitHub Desktop.
OO with bandeirinhas 2/7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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