play again button

Hi, I’m making a game and I’m on the very last detail of my work, I just need a ‘play again’ pushbutton but my code isn’t working:

I want the game to end, so timer1.mode = 0, then I want the player to type yes or no in textfield2 to tell the game whether the player wants to play again or not. This is my code:
if (timer1.mode = 0) or (timer2.mode = 0) or (timer3.mode = 0) then
MsgBox "Game over. " +textfield2.text
end if

if textfield2.text = “Yes” then
Pongball.left = 213
Pongball.top = 192
Pongball.width = 30
Pongball.height = 30
end if

if textfield2.text = “yes” then
Oval1.left = 255
Oval1.top = 234
Oval1.width = 30
Oval1.height = 30
end if

if textfield2.text = “Yes” then
Oval2.left = 213
Oval2.top = 266
Oval2.width = 30
Oval2.height = 30
end if

if textfield2.text = “Yes” then
Oval3.left = 171
Oval3.top = 234
Oval3.width = 30
Oval3.height = 30
end if

(Do you see anything wrong with this or should some of it be in a timer?)

You are asking for the same thing multiple times. ‘if textfield2.text = “yes” then’. AFAIK, the check is also case-insensitive. So checking against ‘yes’ and ‘Yes’ are the same thing if you use the equals operator.

Oh ok, thank you.

You can get it check if you want though. Why are checking the timer mode?

Sorry, don’t quite understand what you mean. Can you please re-arrange your question, please?

Sorry. YOU can get it to check with casing taken into consideration. Why are you referring to the timer mode in your code?

Yea, it’s just I don’t know how to.

I am referring to the timer’s because if I don’t then the score timer and the timer that causes the players to move won’t slow down and the game won’t stop.

I figured it out, but thanks for the help :slight_smile:

[quote=171069:@Walideh Sayed]Yea, it’s just I don’t know how to.

I am referring to the timer’s because if I don’t then the score timer and the timer that causes the players to move won’t slow down and the game won’t stop.

I figured it out, but thanks for the help :)[/quote]
Wouldn’t you want to be looking at the timer’s period for that?

The period changes the speed, but the thing above it makes it turn on and off, if you’re talking about either then no because I start with them off, then have a code to turn them on then they automatically turn off when the game is done.