Stopping at 0

Non-platform specific questions.

Stopping at 0

Postby BlarghNRawr » Sat Sep 27, 2008 4:44 pm

how can i make a score stop at zero, not go into negatives?
i have done this alot before, but i cant remember how :oops:
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Stopping at 0

Postby Thanx » Sat Sep 27, 2008 4:46 pm

Code:
if(score < 0)
{
score = 0;
}

:lol:
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Stopping at 0

Postby BlarghNRawr » Sat Sep 27, 2008 5:04 pm

thanx, thanx
i knew it was easy! :lol:
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron