Jump to content
  • Advertisement
Sign in to follow this  

Easiest wayt to change health value ?

This topic is 4724 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.0f
If (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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Don't be sorry... we all started somewhere. It's always good to ask questions, although I too reccomend learning basic programming before starting on a game.

Good luck to you!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!