Created
February 17, 2022 15:36
-
-
Save eqs/1746a0172fbfd58a8c1e5eca17869b16 to your computer and use it in GitHub Desktop.
q5 example
This file contains 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
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