Oh thanks you guys
I would like to know how in some games you tap to start. How does that work?
That also uses a if then statement
Yes I know but how does it work?
Well do you know about game states…?
If you do:
create a new game state, splashscreen or so
and in that function, add some code that changes the game state when the screen’s touched…
@Mcordova I’m not sure what you mean. but it works with ones and zeros, ones mean true, and zeros mean false. When you program in a IDE, it turns it into ones and zeros.
Or if your wanting to know how to make that then do:
function setup()
start = false
end
function draw()
if start == false then
background(255,255,255)
("Tap screen to start", WIDTH/2, HEIGHT/2)
elseif start == true then
background(255,255,255)
text("Game time!, WIDTH/2, HEIGHT/2)
end
end
function touched(t)
start = true
end
I have a program that utilizes touch to alter between game states, it’s called Tilt Island and it is a great code to look at because it’s very well rounded inbterms of code content. Check it out on CC