Alice Community  

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

Reply
 
Thread Tools Display Modes
If/Else Statement question
Old
BigDawgFan
Guest
 
Status:
Posts: n/a
Default If/Else Statement question - 06-09-2010, 03:24 PM

Thanks in advance for any response I get to this. I'm doing my final project and need to add an If/Else statement. What I have is a newscast that has 4 scenes. After the 2nd scene you have to click your mouse to see the third scene. How do I do an If/Else statement that says "If the mouse was clicked to play scene 3 then play scene 4 after scene 3 otherwise do nothing."
Attached Files
File Type: a2w PierceAliceFinalProject.a2w (10.59 MB, 2 views)
   
Reply With Quote
Old
noahx23
Senior Member
 
noahx23's Avatar
 
Status: Offline
Posts: 81
Join Date: Nov 2009
Location: outside of the box
Default 06-09-2010, 03:39 PM

Here is one way to do it, if you're not very picky about the main problem which is if you click before you're supposed, so if it works for great, if not oh well.
Attached Files
File Type: a2w click.a2w (149.0 KB, 5 views)
   
Reply With Quote
Old
BigDawgFan
Guest
 
Status:
Posts: n/a
Default 06-09-2010, 03:56 PM

Thanks but I have to use an If/Else statement.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 06-09-2010, 04:30 PM

Have a world boolean variable called "scene3End", and set it to false. Then at the end of your scene 3 animation when add a statement turning that variable to true. Then in the event that you made where you click something, have it say "if(scene3End)" for the if statement, and in there just put the initialization for the scene 4 method (or the entire animation if you don't have a separate method for it).


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
noahx23
Senior Member
 
noahx23's Avatar
 
Status: Offline
Posts: 81
Join Date: Nov 2009
Location: outside of the box
Default 06-09-2010, 05:21 PM

Quote:
Originally Posted by BigDawgFan View Post
Thanks but I have to use an If/Else statement.
Ok, I didn't expect it to anyways.
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.