I am working on my programm and I need your help. How can you help? Just tell me the command that stops the class from working or that stops the program for a several amount of time. Also don’t forget to tell me it’s arguments.
@HappyProgrammer11 You don’t stop the program from working. Codea runs in a constant loop and the way you stop something from executing is to not execute its function. You use an if statement to control when a function is called. If you have instances of a class that draws several things on the screen, then use the if statement and some variable to call or not call those instances.
function setup()
end
function draw()
background(40, 40, 50)
fill(255)
text("tap screen to show or not show a sprite",WIDTH/2,HEIGHT-100)
if show then
sprite("Planet Cute:Character Horn Girl",WIDTH/2,HEIGHT/2)
end
end
function touched(t)
if t.state==BEGAN then
show=not show
end
end
function pause(X)
paused=ElapsedTime+X
end
--then set up your draw program like this
function draw()
--don't draw anything if paused
if paused then
if ElapsedTime<paused then return else paused=nil end
end
--your other draw code goes here
end
--then to pause your program for 5 seconds, write this line
pause(5)