Please Help! Anyone!

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.

Everyone, Have a nice day.



A notice to Kire: the command that you given isn’t what I want. I need a command that only makes the programm to sleep, not to crash!

@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.

Here’s an example to show or not show a sprite

function setup()

function draw()
    background(40, 40, 50)
    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)

function touched(t)
    if t.state==BEGAN then
        show=not show

So you want the program to be in some pause/standby?

Again a personal message to Kire: Yes, but I want it to be in the standby for a fixed amount of time.

to pause a program for X seconds, try this

function pause(X)

--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
    --your other draw code goes here

--then to pause your program for 5 seconds, write this line

@Ignatz Big Thanks! That works!

@Ignatz Please, tell me how to use this inside a loop or another function instead for the draw function.

You have to tell your draw function not to draw during a pause.

That’s what my code does.