Lets say i'm making a racing game. And lets say I want to shift gears to increase the speed. The speed variable is "met".
The shift variable is "shift".
I need to make it so that when you hit space, you shift, but only if you are at the top speed for the previous gear.
("n" is the variable for moving X, that doesnt need changing)
If spacekey()=1 then shift=shift+1
if shift=0 then n=2
if shift=1 then n=4 : inc met
if shift=2 and met=40 then n=8 : inc met
if shift=3 and met=80 then n=16 : inc met
ect. ect.
This is a very simple thing... yet my mind doesnt seem to grasp it... mabey it's becuase it's late... but i always run into problems with that code... If i go 40, then shift, then go 80, and shift, the next thing is supposed to be 120, but it goes all the way to 240. (which is the 5th gear) Mabey it's becuase if "met" doesn't meet the requirements for the next gear to take place, shift stays in that gear, but the speed wont change.