Alice Community  

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

Reply
 
Thread Tools Display Modes
Help with shield and sword please
Old
hitherekyle
Junior Member
 
Status: Offline
Posts: 3
Join Date: Oct 2011
Default Help with shield and sword please - 01-28-2012, 08:50 PM

Hello! I kind of need some help with my Alice game. In the game I have a shield and sword. I need it so that when my shield is up, my sword cannot attack or do anything. When my shield is down, I need my sword to attack. However, I can not figure out how to do this. I can get both the shield and sword to do there thing, except it happens at the same time. Also, for some reason, my shield and sword loop there commands when there is no loop, I even added a loop statement with 1 loop and it still does the same thing. I got this to work before, and I swear I do not know why it's not working now. Thank you if any of you guys can help.
Attached Files
File Type: a2w AliceRPGKnight.a2w (1.99 MB, 7 views)
   
Reply With Quote
Old
hitherekyle
Junior Member
 
Status: Offline
Posts: 3
Join Date: Oct 2011
Default 01-28-2012, 08:57 PM

Well this is really weird, I saved my project and loaded it up and now my its working like it is supposed to. I am guessing this was an Alice glitch.
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 01-29-2012, 02:05 AM

if you don't want to be able to block and attack at the same time, you will need an if/else statement and two variables(you can do it other ways as well but in this case i'll explain it this way), the best variable to use in this case would probably be a boolean variable. if you are not sure what that is. a boolean variable says whether or not that piece of data is true or false. so for your if/else statement, you would have

"if block == true"
set attack variable to false
do blocking animation
else:
set attack variable to true

What that means is if the "blocking" variable is true, only blocking will be allowed to happen, and for the else section, it means if the "blocking" variable becomes false, it will set your "attack" variable to true allowing to attack but not block.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
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.