I'm making a sonic game and I can't think of a way to make you have a short boost when you overlap an object.


I'm making a sonic game and I can't think of a way to make you have a short boost when you overlap an object.


If you've ever Played Sonic Rush or Sonic Adventure 2 Battle, I'm trying to get the effect that happens when you in the air and you go through those red rings and you go a little ways forward.
If somebody could tell me how to get that to happen when you run through a certain object


I haven't played those, but I would expect it would be something like having a flag on. Flag on + only one action when event loops: "set maximum speed to X", "set direction to D" and "set speed to X" X = the speed you want, and D = what direction the boost will be in.
Then:
Flag on: Set speed to speed("object")-1
Then to eliminate the boost:
Flag on + speed("object") < N: Set maximum speed to N and turn Flag off
N = the original maximum speed.![]()



set a condition when object 1 (player) collides with object 2 (what ever it is the player needs to hit for the boost)
when that collison occurs, then you can set a global value on the player to "on"
then set a condition that if that global value = "on" speed = speed+100 etc or what ever effect you need to do.
you can then set another condition to "every 5 seconds" set the players flag back to "off" that way the boost will only last a short period of time
never played that particual sonic game, but the idea is pretty much the same for any temp ability for a player in a game:
1) player collides/overlaps with target
2) set player specific flag or global value on
3) check if flag is on, if so, add special event, speed, color etc.
4) set a timer to disable the special event and set the flag/gv back to off after a specified or random time
hope that helps, or give u a general idea on how to make it function. this process is prety much the same as when you check if a player has "shot" and enemy, or been shot by an enemny, etc.


Problem with that boost is that it doesn't slow down slowly before returning to normal.
My way you can manipulate to go just as long and still have it fade back.
But otherwise they are basically the same idea, turn something on, add to speed, turn that something off after a while.


I'm still having a problem =(
It slows me down instead of making me go faster.


Hmm?
Can you post an example? That really shouldn't happen...