Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Resetting a game
Old
deadlyrun123
Junior Member
 
Status: Offline
Posts: 3
Join Date: Dec 2013
Post Resetting a game - 01-01-2014, 08: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.
   
Reply With Quote
Advice
Old
clk4suport
Junior Member
 
Status: Offline
Posts: 12
Join Date: Nov 2013
Location: new delhi
Smile Advice - 01-02-2014, 12:16 AM

Hello,

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

Thank You.
   
Reply With Quote
Old
deadlyrun123
Junior Member
 
Status: Offline
Posts: 3
Join Date: Dec 2013
Default 01-02-2014, 07:43 PM

Quote:
Originally Posted by clk4suport View Post
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.
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 01-14-2014, 07: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
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.