It seems to be a problem with the whole action/movement code.
I added the above and removed the other rolling codes,but sonic is keeping getting faster when walking on Slopes and Loops...
Heres the Whole Step Action/Movement script if you like to see it:
Also,your code only would work like this for me:
if (x_speed < 0) {
if (key_right) x_speed = min(0, x_speed+roll_decc_strong);
else x_speed = min(0, x_speed+roll_decc);
} else if (x_speed > 0) {
if (key_left) x_speed = max(0, x_speed-roll_decc_strong);
else x_speed = max(0, x_speed-roll_decc);
}
// Deceleration based on angle
if ( ((x_speed > 0.0) && (relative_angle < 180)) || ((x_speed < 0.0) && (relative_angle > 180)))
x_speed -= global.SinTable[relative_angle]*roll_decc_factor_up;
if ( ((x_speed < 0.0) && (relative_angle < 180)) || ((x_speed > 0.0) && (relative_angle > 180)))
x_speed -= global.SinTable[relative_angle]*roll_decc_factor_down;
// If player isn't on ground anymore, or pressed, switch to jump.
if (!ground) {
action = action_jumping;
}
else if (key_action_pressed) {
action = action_jumping;
shield_usable = 1;
}
// If player definitely stopped, just change to normal.
else if (x_speed == 0.0) {
action = action_normal;
shield_usable = 1;
}