Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #implementation of my Scratch project [ https://scratch.mit.edu/projects/121049579/#player ] in Processing.
- import timeit
- import math
- start_time = timeit.default_timer()
- theta = 0
- timer = 0
- def setup():
- size(800, 800)
- background(255)
- frameRate(66)
- noStroke()
- fill(0)
- def draw():
- if mousePressed == False: # Click to disable clearing
- background(255)
- display()
- def display():
- global theta
- global timer
- theta = 0
- pattern_id = 249 #_;
- timer = (timeit.default_timer() - start_time)
- while theta <= 360:
- temp = math.radians(theta)
- ellipse(cos(temp)*(width/2.25*sin(((timer/300)+(temp/5))*pattern_id)) + width/2,sin(temp)*(height/2.25*sin(((timer/300)+(temp/5))*pattern_id)) + height/2,3,3)
- theta = theta + 3.6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement