PDA

View Full Version : Resetting a game


deadlyrun123
01-01-2014, 09:27 PM
In my fighter game, I have made characters that have lives(by creating a whole number property) and when a character's lives reaches zero, the game ends. I know how to add a text object and a mouse click listener, but what I do not know is how to make it start again as soon as you click on the restart button after the game has ended. For example, if I click on the text object, it should be redirected to the start of the game, so 'thisEventRunning'=true, and 'thisGameOver'=false.

clk4suport
01-02-2014, 01:16 AM
Hello,

As per me, you have concern your problem with some expert in particular field.
Because it requires expert attention.

Thank You.

deadlyrun123
01-02-2014, 08:43 PM
Hello,

As per me, you have concern your problem with some expert in particular field.
Because it requires expert attention.

Thank You.

I think I already I understand that, and look forward to someone contributing something useful to my question.

chickentree
01-14-2014, 08:38 AM
In my fighter game, I have made characters that have lives(by creating a whole number property) and when a character's lives reaches zero, the game ends. I know how to add a text object and a mouse click listener, but what I do not know is how to make it start again as soon as you click on the restart button after the game has ended. For example, if I click on the text object, it should be redirected to the start of the game, so 'thisEventRunning'=true, and 'thisGameOver'=false.

If I understand what you are asking, you need a method that sets all the variables and objects to their initial condition and then runs the game again. This probably means that you need the initial pose and position for any object that moves. Basically something like:

init
// initialize all global variables, and movable objects

call run


run
// go until no lives remain
ask do you want to play again?
if yes then
init
else
// Do nothing
// exit movie