Advertisement

Easiest wayt to change health value ?

Started by June 13, 2005 12:58 PM
6 comments, last by GameDev.net 19 years, 8 months ago
What is the easiest way to change health value when i press Space... ? health = 100 <Space> health = 99
"I'm a programmer honey, but you can't beat me" Loaning from the Hurriganes - Roadrunner
Try useing health as a float or bool
e.g.
float health:
health = 100.0f;
If (keys[VK_SPACE])
{
health = health - 1.0f;
}
Advertisement
Oh... I've forgotten...


I have write upperleft corner numbers, that indicates how much do you have health, as a test. I want to decrease health value when i press Space... just wondering what those mean...

health = 100.0fIf (keys[VK_SPACE]){health = health - 1.0f}

Just i wont draw any polygons. Doesn't those are feet (f = feet)...


And what can i do with float, i know what to do with bool. It's TRUE or FALSE...

So, if i use bool on health, when i get hit, i change it TRUE. then game is over when my helath is zero, when i get one hit...
"I'm a programmer honey, but you can't beat me" Loaning from the Hurriganes - Roadrunner
I strongly suggest you learn some general programming first (in any language you wish) before using OpenGL as you are missing some fundamentals. Here is a good start.
You should never let your fears become the boundaries of your dreams.
f is what you put after an integer wich is a float.
A float is a floating point integer.
when pressing space it decreases the value of health by 1
not 100
1
and the game wouldn't be over unless you code it to quit when it reaches 0
how long you been programming anyway??
( i use C++ btw)
LMAF
hahahha lol lol lol

.... This deserves to be in the Funny News Blogs
Quicky would you mind if i posted it there....

i dont have to link it 2 you...
----------------------------

http://djoubert.co.uk
Advertisement
sorry that i asked...
"I'm a programmer honey, but you can't beat me" Loaning from the Hurriganes - Roadrunner

This topic is closed to new replies.

Advertisement