Skip to content

Instantly share code, notes, and snippets.

@villares
Created April 15, 2020 15:37
Show Gist options
  • Save villares/9bcc9710eea8203899c63b941bbc994a to your computer and use it in GitHub Desktop.
Save villares/9bcc9710eea8203899c63b941bbc994a to your computer and use it in GitHub Desktop.
def inicie_caneta(*args):
global caneta
caneta = True
resetMatrix()
if args:
x, y = args
translate(x, y)
else:
translate(width / 2, height / 2)
rotate(HALF_PI)
def va_para(x, y):
resetMatrix()
translate(x, y)
def suba_caneta():
global caneta
caneta = False
def baixe_caneta():
global caneta
caneta = True
def ande(n):
if caneta:
line(0, -n, 0, 0)
translate(0, -n)
def vire(a):
rotate(radians(-a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment