Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How Do I? (http://www.alice.org/community/forumdisplay.php?f=28)
-   -   Setting Lives (http://www.alice.org/community/showthread.php?t=10435)

deadlyrun123 12-27-2013 03:19 PM

Setting Lives
 
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.

fourbros 12-27-2013 06: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. :}

mnuffer 11-07-2014 02:05 PM

Scoring/Lives/Timers Etc.
 
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!

MrMoke 11-07-2014 07:20 PM

It can be Frustrating
 
1 Attachment(s)
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

ajsnarr98 11-09-2014 10:19 AM

My idea for a health bar
 
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.

MrMoke 11-10-2014 09:15 AM

This might work too
 
1 Attachment(s)
This method could be implemented in several different ways, and save space by cutting down the number of bars to one...

mnuffer 11-10-2014 11:33 AM

Mr. Moeke
 
Thanks for the code sample. It is what I was looking for. Thanks!

MrMoke 11-11-2014 09:43 AM

Great
 
Glad I could help.

hmerrillb 11-23-2014 10:21 AM

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


All times are GMT -5. The time now is 04:26 PM.

Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.