X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameloop.cpp;h=d05379f9dd3d760b87592cf88059d714dbe46798;hb=546364c9567ef212ea9276201facf73f5ada696a;hp=4d3c792590e74c9d527e785623424258e2eaaf68;hpb=1db9b1a8cf477ba8a676eb2046342ae02c3d3b96;p=supertux.git diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 4d3c79259..d05379f9d 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(); @@ -476,6 +477,22 @@ GameSession::process_events() currentsector->camera->reset(Vector(tux.base.x, tux.base.y)); last_keys.clear(); } + // temporary to help player's choosing a flapping + if(compare_last(last_keys, "marek")) + { + tux.flapping_mode = Player::MAREK_FLAP; + last_keys.clear(); + } + if(compare_last(last_keys, "ricardo")) + { + tux.flapping_mode = Player::RICARDO_FLAP; + last_keys.clear(); + } + if(compare_last(last_keys, "ryan")) + { + tux.flapping_mode = Player::RYAN_FLAP; + last_keys.clear(); + } break; case SDL_JOYAXISMOTION: @@ -500,11 +517,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; @@ -531,7 +557,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) @@ -539,7 +565,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; @@ -628,8 +654,9 @@ GameSession::action(double frame_ratio) int red = rand() % 255; // calculate firework color int green = rand() % red; - currentsector->add_particles(epicenter, Vector(1.4,1.4), Vector(0,0), - 45, Color(red,green,0), 3, 1300); + currentsector->add_particles(epicenter, 0, 360, Vector(1.4,1.4), + Vector(0,0), 45, Color(red,green,0), 3, 1300, + LAYER_FOREGROUND1+1); SoundManager::get()->play_sound(IDToSound(SND_FIREWORKS)); random_timer.start(rand() % 400 + 600); // next firework @@ -960,12 +987,11 @@ bool process_load_game_menu() if (access(slotfile.c_str(), F_OK) != 0) { + shrink_fade(Vector(screen->w/2,screen->h/2), 600); draw_intro(); } - // shrink_fade(Point((screen->w/2),(screen->h/2)), 1000); fadeout(256); - DrawingContext context; context.draw_text(white_text, "Loading...", Vector(screen->w/2, screen->h/2), CENTER_ALLIGN, LAYER_FOREGROUND1);