Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I make my Life Bar work?
Old
JMysterial
Guest
 
Status:
Posts: n/a
Default How do I make my Life Bar work? - 03-28-2011, 04:11 PM

Hello everyone, I need some help with my school project.
I'm making a FPS in which you are a spiderRobot and you have to defeat other space enemies. I made methods so it can shoot, I already programmed the enemies to move and search for the spider robot, and I even programmed the enemies to disappear when they are hit.
The problem here, is that I wanted the robot to have 3 lifepoints, so I put 3 cubes together vehicled to the camera so it looks like a Life Bar . I already programmed a method in which if you are detected by an enemy, you receive damage and your life goes down. It kinda works, because if you are hit, 1 cube turns red (simulating you took damage). However, if you are hit again, the second cube won't turn red. I programmed it so that if you are hit three times, you lose. However, no matter how many times I'm hit, the Life Bar won't go below 2, so if you can help me, I'd really appreciate it.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 03-28-2011, 04:21 PM

Hello, I actually made an example for another user for his game so it should work perfectly fine with you. If you have basic understandings of Alice you should be able to duplicate my example into your game. You can change how far the Right cube moves to the left inorder to make it a 3 hit process. This way should be easy. Enjoy!
Attached Files
File Type: a2w Health_Bar_Example - 2.a2w (643.8 KB, 39 views)


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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 03-29-2011, 08:55 AM

If you don't understand jedi's health bar, here is an example I made for a different person as well. My health bar is slightly different, and as it goes down, it changes color.
Attached Files
File Type: a2w Health Bar.a2w (257.2 KB, 42 views)
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 03-29-2011, 04:55 PM

David, this is like the other thread. I said I can help and I say I will make an example, then you come in and say you will make an example to help out. Mine is confusing?


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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 03-29-2011, 05:10 PM

Quote:
Originally Posted by jediaction View Post
David, this is like the other thread. I said I can help and I say I will make an example, then you come in and say you will make an example to help out. Mine is confusing?
I am not saying that yours is confusing, but I am saying that if JMysterial has trouble understanding yours, then he can always fall back on mine, and he won't have to ask for a different type of bar. I am not trying to degrade you, your projects, or your health bar in any way, shape, or form. Just so you know.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 03-29-2011, 05:13 PM

How do you know he has trouble?


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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 03-29-2011, 05:16 PM

Quote:
Originally Posted by jediaction View Post
How do you know he has trouble?
I don't. (Okay, you got me. I like to post on the forums. I try to avoid spam the best I can.)
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 03-29-2011, 05:28 PM

Are you just trying to post because your trying to become higher in posting? Thats going to end up as spam....DONT DO IT


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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 03-29-2011, 05:33 PM

Quote:
Originally Posted by jediaction View Post
Are you just trying to post because your trying to become higher in posting? Thats going to end up as spam....DONT DO IT
No. I am not doing it to increase my post count. I am doing it just for the simple reason that I am a forums freak.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 03-29-2011, 07:23 PM

k


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
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.