char*key=GetKeyState();
if (key[KEY_RIGHT]==1) {
double speed;
speed=speed+0.2;
counterspeed=counterspeed+0.2;
speedometer.textNumber=speedometer.textNumber+0.2;
x=x+speed;
}
else {
counterspeed=counterspeed-0.2;
}
if (key[KEY_RIGHT]==0) {
double speed;
speed=0;
speedometer.textNumber=0;
}
if (key[KEY_RIGHT]==0 && key[KEY_LEFT]==1 && counterspeed>30) {
epilete.r=100;
epilete.g=255;
epilete.b=255;
counterspeed=counterspeed-0.9;
//Colors for example, you can use sonic dashing animation;
}
else {
epilete.r=255;
epilete.g=255;
epilete.b=255;
//return animation
}
if (counterspeed<1) {
counterspeed=0;
}
//and you will set the backward speed only
//epilete=sonic =D
Users browsing this forum: No registered users and 1 guest