View Single Post
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 09-28-2010, 05:17 PM

You can make separate boolean variables for each action of your person. For example, lets say you have the ability to look down your sights, but you don't want people to be able to do it while reloading. Create a boolean variable called "isReloading" and keep it set it to default "False". Now in the event where you call upon the gun reloading, just put an if/else statement in the place of that method and put "if(isReloading), do nothing; else, person.aimDownSights". Now in the method where you are reloading, in the method itself before you do anything else, set "isReloading" to "True" in the beginning, and then when the animation finishes, set "isReloading" to "False" again. This way, when you go to reload, it will turn the boolean on, therefore disabling you from aiming down your sights, and as soon as the reloading ends and the boolean turns back to false, you can aim down your sights again. You can repeat this process with all of your other methods that you do not want to happen while reloading. Or you can create difference booleans so that, lets say you cannot reload while you are running, or look down your sights while you are running.


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