Jump to content
  • Advertisement
Sign in to follow this  
Quicky

Easiest wayt to change health value ?

This topic is 4851 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

What is the easiest way to change health value when i press Space... ? health = 100 <Space> health = 99

Share this post


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

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!