Alice Community  

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

Reply
 
Thread Tools Display Modes
If then statements
Old
dkwalabama
Guest
 
Status:
Posts: n/a
Wink If then statements - 08-03-2009, 09:30 PM

What can I use if then statements for in Alice?
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 08-03-2009, 10:54 PM

If statements check to see if a condition is true, then acting on that information. There's plenty of functions they can serve, for example:

-A bullet is fired by a player towards an enemy. An "if bullet is within x meters of enemy" method would be used to check to see if the bullet hits.

-The bullet does hit and the enemy's health goes down by a certain amount. An "if health is greater than zero" method would be used to check to see if the enemy is dead.

-The enemy is still alive, and now tries to attack the player. More if statements would be used to see if the player was close enough for the enemy to counterattack, if the enemy's attack hit, and so on.

If statements are primarily useful for games and other such interactive programs in which conditions must be constantly monitored for proper function of the Alice world.


(')>
   
Reply With Quote
Old
Veryuhbull
Guest
 
Status:
Posts: n/a
Default 08-04-2009, 10:25 AM

also that can be
checkpoints for a game
collision detection
loop breakers
sorters
routers
psyhics simulation
psuedo-parameters
building blocks for functions
   
Reply With Quote
Reply


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.