X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameloop.cpp;h=6fa78367c47df0e188054ccc1e83f002a8a0422d;hb=42503cac8eac1199cccec2d4fbed7fde41a2bb55;hp=12272310ce8fdbaf838ff91c07ba9ee3931f11ba;hpb=2236c2d6e68a9a3bbff4dd2953f868ee2aae8f6a;p=supertux.git diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 12272310c..6fa78367c 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -248,11 +248,12 @@ GameSession::on_escape_press() it could have nasty bugs, like going allways to the right or whatever that key does */ Player& tux = *(currentsector->player); - tux.key_event((SDLKey)keymap.jump, UP); - tux.key_event((SDLKey)keymap.duck, UP); + tux.key_event((SDLKey)keymap.up, UP); + tux.key_event((SDLKey)keymap.down, UP); tux.key_event((SDLKey)keymap.left, UP); tux.key_event((SDLKey)keymap.right, UP); - tux.key_event((SDLKey)keymap.fire, UP); + tux.key_event((SDLKey)keymap.jump, UP); + tux.key_event((SDLKey)keymap.power, UP); Menu::set_current(game_menu); Ticks::pause_start(); @@ -443,6 +444,11 @@ GameSession::process_events() player_status.lives--; last_keys.clear(); } + if(compare_last(last_keys, "grease")) + { + tux.physic.set_velocity_x(tux.physic.get_velocity_x()*3); + last_keys.clear(); + } if(compare_last(last_keys, "invincible")) { // be invincle for the rest of the level tux.invincible_timer.start(time_left.get_left()); @@ -495,11 +501,20 @@ GameSession::process_events() else if (event.jaxis.axis == joystick_keymap.y_axis) { if (event.jaxis.value > joystick_keymap.dead_zone) - tux.input.down = DOWN; - else if (event.jaxis.value < -joystick_keymap.dead_zone) + { + tux.input.up = DOWN; tux.input.down = UP; + } + else if (event.jaxis.value < -joystick_keymap.dead_zone) + { + tux.input.up = UP; + tux.input.down = DOWN; + } else - tux.input.down = UP; + { + tux.input.up = DOWN; + tux.input.down = DOWN; + } } break; @@ -526,7 +541,7 @@ GameSession::process_events() case SDL_JOYBUTTONDOWN: if (event.jbutton.button == joystick_keymap.a_button) - tux.input.up = DOWN; + tux.input.jump = DOWN; else if (event.jbutton.button == joystick_keymap.b_button) tux.input.fire = DOWN; else if (event.jbutton.button == joystick_keymap.start_button) @@ -534,7 +549,7 @@ GameSession::process_events() break; case SDL_JOYBUTTONUP: if (event.jbutton.button == joystick_keymap.a_button) - tux.input.up = UP; + tux.input.jump = UP; else if (event.jbutton.button == joystick_keymap.b_button) tux.input.fire = UP; break;