Skip to content

Instantly share code, notes, and snippets.

@eqs
Created February 17, 2022 15:36
Show Gist options
  • Save eqs/1746a0172fbfd58a8c1e5eca17869b16 to your computer and use it in GitHub Desktop.
Save eqs/1746a0172fbfd58a8c1e5eca17869b16 to your computer and use it in GitHub Desktop.
q5 example
import math
import q5
class App(q5.BaseApp):
def __init__(self):
self.x = 0.0
self.y = 0.0
def update(self):
t = q5.frame_count
u = t / 60.0 * 2 * math.pi
self.x = 100.0 * math.cos(u)
self.y = 100.0 * math.sin(u)
def draw(self):
q5.background(220, 220, 220)
q5.translate(self.x, self.y)
q5.ellipse(0.0, 0.0, 100.0, 100.0)
if __name__ == '__main__':
app = App()
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment