View Single Post
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 01-14-2014, 08:38 AM

Quote:
Originally Posted by deadlyrun123 View Post
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:

Code:
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


Mark Henwood
mhenwood@ieee.org
   
Reply With Quote