Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
syntaxJedi
13
Years of Service
User Offline
Joined: 25th Nov 2012
Location:
Posted: 26th Nov 2012 04:58
So i'm making this game for school where your a can running around trying to grab fruit. I have made it so when you get a score of 2000 or more you get the option to boost for 17 seconds. The problem is that when i have the game display the boost timer i can't boost, but when i move the timer around so i can boost it starts at a negative number. The piece of code i'm using isn't the most efficient but here it is, please tell me if you see anything wrong with it
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 26th Nov 2012 06:40
you havnt reset myboost back to its original value.
so it keeps subtracting from where it last stopped

you have commented out the line that stops myboost going below zero

MyBoost = MyBoost - 1 occurs after your if MyBoost <= 0 so even if you unrem the myboost = 0 it will still read -1

also

remove then from your if statement, then is only used for one line if statements.

place endif at the end of your if statement eg


Login to post a reply

Server time is: 2026-07-08 06:44:53
Your offset time is: 2026-07-08 06:44:53