Hello,
I'm trying to make a game where the character does this move kind of like sonic's "dash"/"boost"? thing;
That move, where when you press a button, sonic starts rolling, and when you release it, sonic runs off as fast as hell.
You know what I'm talking about right?
Anyway,
so far I've come up with this:
Code:
//Boost?
function CallBoost() {
if (Boost == true) {
if (rolling == false) {
_x+=50;
}
} else {
//if not rolling..
if (Key.isDown(83)) {
//if 'S' is pressed
rolling = true;
Boost = true;
}
}
}
//Boost?End
or something like that.
I have a listener to detect when the 'S' key is released, (rolling = false),
so what I want to do is, when the 'S' key is released, the character keeps the rolling animation but moving to the right (slow>very fast>fast>slow>stop), leaving an alpha trail.
Any ideas on how to do this?
Thanks,
-javier