Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Decrementing health? (http://www.alice.org/community/showthread.php?t=2581)

A.Haak 04-25-2009 06:52 AM

Decrementing health?
 
Hi.

I am making a simple FPS game for my class. I want to know how to make it so that one of the monsters has, say, 5 'health' and everytime you shoot it decrements by one. When it hits 0 I want it to change opacity to 0 or do a 'die' method (haven't created it yet). I'm guessing you make a number variable in 'properties' for whatever character you want to do it with but I can't find the decrement value in Alice.

Thanks for any help.

Oh yeah, while i'm posting here I might as well ask another question.

How do I make objects 'solid' so my character (which is the camera, I have just made the camera the vehicle for my gun) does not walk through them like they aren't there? Kind of makes it hard to make sure whoever plays the game doesn't stuff up straight away and throw the whole thing out of whack.

pingu 04-28-2009 07:21 PM

[B]i have no idea[/B]. [COLOR="Magenta"][B]but,[/B][/COLOR] i do know that there have been numerous posts about this kind of thing. however, i'm not sure that they've all been answered. just have a look and see what you can find, or check with a senior member (like Dr Jim)

pingu :p

x2495iiii 04-29-2009 02:34 PM

Simply make the variable under the properties tab, then drag the variable out into your script. A pop-up with 3 options will appear, one of them being decrement variable by 1. Click it and it will appear in the script.


All times are GMT -5. The time now is 03:52 AM.

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