You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you hit run on the following code it will work but if you hit run again it will break and require a page refresh:
from processing import *
from math import sin, cos
global angle
angle = 0
def setup():
size(250, 250)
def draw():
global angle
background(220)
translate(environment.width/2, environment.height/2)
line(0, 0, 100*cos(angle), 100*sin(angle))
angle += 0.03
run()
whereas the following code will work repeatedly (doesn't use the translate function):
from processing import *
from math import sin, cos
global angle
angle = 0
def setup():
size(250, 250)
def draw():
global angle
background(220)
line(environment.width/2, environment.height/2, environment.width/2+100*cos(angle), environment.height/2+100*sin(angle))
angle += 0.03
run()
The text was updated successfully, but these errors were encountered:
Hi,
i don't think the translate function is working as intended, trying to run some code here: http://www.skulpt.org/static/proctest.html
If you hit run on the following code it will work but if you hit run again it will break and require a page refresh:
whereas the following code will work repeatedly (doesn't use the translate function):
The text was updated successfully, but these errors were encountered: