Alice Community  

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

Reply
 
Thread Tools Display Modes
How do you make a variable you make work?
Old
Jones989
Senior Member
 
Jones989's Avatar
 
Status: Offline
Posts: 61
Join Date: Jun 2011
Unhappy How do you make a variable you make work? - 06-13-2011, 12:34 PM

I need help with a game I am making. I want to make a variable that is called world.forever that will ask the player if he wants to play forever or not. I already know how to make Alice ask, but how do i make it go forever if the variable is true and and not if its false?
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 06-13-2011, 01:04 PM

Well, if the variable is a number variable, and the person says "yes" to play forever, then have the variable to set value to infinity. (just type infinity into the custom numbers)


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 06-13-2011, 01:12 PM

You could use an if/else method. See the attached program for an example. The text will tell you what the variable is set to, and to gurantee no errors, I have put a watch on the variable so you can see the actual variable.

I hope this helps.
Attached Files
File Type: a2w ExampleVariable.a2w (186.8 KB, 3 views)
   
Reply With Quote
Old
Jones989
Senior Member
 
Jones989's Avatar
 
Status: Offline
Posts: 61
Join Date: Jun 2011
Default 06-13-2011, 03:04 PM

Thanks both of you! Now I guarantee that the game will be finshed Eventually...
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 06-13-2011, 03:45 PM

Quote:
Originally Posted by Jones989 View Post
Thanks both of you! Now I guarantee that the game will be finshed Eventually...
Your welcome! Anytime you need help, just ask.
   
Reply With Quote
Reply

Tags
need help, true/false, variable

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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.