Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
Setting Lives
Old
deadlyrun123
Junior Member
 
Status: Offline
Posts: 3
Join Date: Dec 2013
Question Setting Lives - 12-27-2013, 02:19 PM

Hey guys, I am new to the Alice community, and would like some assistance in my project. I am making a fighter project, similar to dragon ball z; I know how to make event listeners, while loops, and if statements as well as collisions. I am really stuck on setting lives for my character and the villain it is going to fight. I would like to know how to make the lives of a character go down each time a character is punched.
   
Reply With Quote
Old
fourbros
Senior Member
 
fourbros's Avatar
 
Status: Offline
Posts: 476
Join Date: Nov 2011
Location: Right Behind You...
Default 12-27-2013, 05:11 PM

The dbz game sounds interesting. If you want to make an hp bar, use variables. For an example; set the variable(called HP) to 10. Each time a character is hit, HP gets decremented by 1. Once HP has been knocked down all the way to zero, the other character wins.

Hope this helps.



PS: I'm pretty sure that arty\sfunk\jediaction\etc. could come up with better advice. :}


My avatar is from the anime "Hyouka".......

You've probably never seen it, much less heard of it.....

You should watch it........


print("Hello World")
This is python code.

Lakers > Clippers
Vikings > Packers
Cardinals > Brewers/Pirates/Cubs/Reds
   
Reply With Quote
Scoring/Lives/Timers Etc.
Old
mnuffer
Junior Member
 
Status: Offline
Posts: 5
Join Date: Sep 2014
Default Scoring/Lives/Timers Etc. - 11-07-2014, 01:05 PM

I, too, am struggling with how to either count lives, track time or show a score. I can create a variable called score as I did in Alice 2 and then decrement it as appropriate. My problem comes in that I can't see the variable change value and I can't convert the number variable to a string so that it can be used as text for the 3D text object that would show the score or time, etc. Please help!
   
Reply With Quote
It can be Frustrating
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default It can be Frustrating - 11-07-2014, 06:20 PM

It's not as clean as in Alice2, but it can be done after a little research.

Attached is a short countdown program as an example. Forum doesn't allow .a3p files to be uploaded, so I had to zip it.

Good Luck
Attached Files
File Type: zip countdown.zip (26.2 KB, 4 views)

Last edited by MrMoke; 11-08-2014 at 04:40 PM.
   
Reply With Quote
My idea for a health bar
Old
ajsnarr98
Guest
 
Status:
Posts: n/a
Smile My idea for a health bar - 11-09-2014, 09:19 AM

I am currently making a game in alice 3 that has a health bar. The way it works is there are 10 billboards that I created with a custom image. To do that click on the project tab, then resource manager and then import image. If you create the billboard with the image on it it will be automatically resized to the image. Each of my billboards is a version of the health bar with a different amount of health. The way the bar works is I have a shape called healthBarMarker which is a vehicle to the camera and a variable called health. The health bar being currently used is also a vehicle of the camera. When the health variable decreases, the current health bar is given an opacity of 0 and the new health bar an opacity of 9. Then the first health bar ceases to be a vehicle of the camera and the new one does. The new one is then moved and oriented to the shape called healthBarMarker. Each of these actions has a duration of .01 seconds.
   
Reply With Quote
This might work too
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default This might work too - 11-10-2014, 08:15 AM

This method could be implemented in several different ways, and save space by cutting down the number of bars to one...
Attached Files
File Type: zip BarShrinker.zip (27.2 KB, 17 views)
   
Reply With Quote
Mr. Moeke
Old
mnuffer
Junior Member
 
Status: Offline
Posts: 5
Join Date: Sep 2014
Default Mr. Moeke - 11-10-2014, 10:33 AM

Thanks for the code sample. It is what I was looking for. Thanks!
   
Reply With Quote
Great
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Great - 11-11-2014, 08:43 AM

Glad I could help.
   
Reply With Quote
Old
hmerrillb
Junior Member
 
Status: Offline
Posts: 10
Join Date: Nov 2014
Location: usa
Default 11-23-2014, 09:21 AM

helpful topic..it helped me lot...thanks guyes..


"I would prefer to have no money but to have a nice family and good friends around"
  Send a message via Yahoo to hmerrillb Send a message via MSN to hmerrillb  
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.