How to speed up the touch’s ticked up

Okay I have a problem that is driving me mad. So in my game in had the set up and all then I choose that it needed to have a menu it started on so I moved the setup and draw to a new file and renamed the setup (and made a new one) but now it keeps saying error the line that the setup was on before can you please tell me who to remove this error.

Thanks pac

It’s okay I ficked it all I did was put it back where it was then it went away.

How do you clear a sprite off the screen. And have a scene start drawing?

Thanks pac

To clear a sprite off the screen, you stop drawing it. To have a scene start drawing, you start drawing it. Your question isn’t very clear as to what you’re trying to do.

@pac - to switch sprites on and off you need a conditional check …

If condition == true then
          show sprite
else 
          Dont show sprite
end

You obviously need to add your own code, you may want to move the sprite, change it move to another page if your sprite is a button. All in draw() function or a sub function called within the draw function.

Hope that helps.

I know that is how it suppose to work but when I stop drawing the sprite it stays one the screen and blinks

On sorry bad iPad spellcheck

@pac - show us a little of your code then we understand what you are trying to do.

Sounds like you are alternating a conditions.

function MainMenuDraw()

if GameMode == 1 then
    --draw the sprite for the start button
    


    if i < 120 then
        sprite("Project:entry001", 500, 500, 200, 200)
    
    end

    i = i + 1

end
print(i)

end

This function gets called by the draw function but the sprite does not go away after i go over 120 so please help me know ho to get the sprite to go away.

@pac - check to see if you modify i in your other code, it looks like a global. If it resets to 0 or 1 then you will never stop it displaying hence the flash when
I == 121.

Also, it looks like you may be waiting for a start button to be tapped. You should set that code up in the touched(t) function. Without seeing most of your code we can’t see where the error is.

@pac Do you have the background() command at the start of your draw() function. Sounds like you’re not clearing the screen each draw cycle.

@pac Here’s an example of switching screens. Slide the switch to switch screens.

function setup()
    parameter.boolean("switch",false)
end

function draw()
    background(0)
    if switch then
        screen2()
    else
        screen1()
    end
end

function screen1()
    background(223, 171, 154, 255)
    fill(255, 0, 0, 255)
    text("Screen1",WIDTH/2,HEIGHT-200)
    sprite("Planet Cute:Character Horn Girl",WIDTH/2,HEIGHT/2)
end

function screen2()
    background(169, 222, 188, 255)
    fill(255, 0, 0, 255)
    text("Screen2",WIDTH/2,HEIGHT-200)
    sprite("Small World:Court",WIDTH/2,HEIGHT/2)
end

Dave you are amazing at telling what I have wrong.

It works now thank you some much.

So I have one thing that I don’t know how to do but would like to and kind of need to know. How do you make a triangle plane?

Thanks Pac

One more thing for now… How do you make material for the 3D object.

I got a few more questions. How do you save and load 3D files in codea.

It’s okay if you don’t know I will work one it the only problem I will have is the data safe metality that apple has.