So I don’t know if this is even a minor problem, or if it’s just limited to the editor, or whatever but anyway I felt like sharing it.
so you run the below test code, tapping the screen should print (155, 0, 0, 255). BUT, if you refresh it using the refresh icon and tap immediately after, it only prints nil
-- Test code, touched() is running before setup()?
-- You need to tap the screen quickly after refreshing to see this
-- red should print (155, 0, 0, 255)
-- but if you refresh and tap fast enough you just get nil
function setup()
red = color(155,0,0)
blue = color(153, 153, 223, 255)
green = color(0,155,0)
yellow = color(200,200,0)
end
function draw()
background(40, 40, 50)
strokeWidth(5)
end
function touched(touch)
if touch.state == BEGAN then
print(red)
end
end