X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fplayer.cpp;h=afc4eb5e078232cd59033ee104e21c43118c7809;hb=54769dff40025a2e798d2544df6d745196968f94;hp=8d0a2eec64a075823520ac74a861922e229dbb0f;hpb=1908d105d9aa5869b46829bac0cd79623ec60601;p=supertux.git diff --git a/src/player.cpp b/src/player.cpp index 8d0a2eec6..afc4eb5e0 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -371,7 +371,7 @@ Player::handle_horizontal_input() void Player::handle_vertical_input() { - if(input.up == DOWN) + if(input.up == DOWN && input.old_up == UP) { if (on_ground()) { @@ -410,6 +410,7 @@ Player::handle_input() { handle_vertical_input(); } + input.old_up = input.up; /* Shoot! */ @@ -455,11 +456,25 @@ Player::handle_input() duck = false; base.y -= 32; base.height = 64; - old_base = previous_base = base; + // changing base size confuses collision otherwise + old_base = previous_base = base; } } void +Player::grow() +{ + if(size == BIG) + return; + + size = BIG; + base.height = 64; + base.y -= 32; + + old_base = previous_base = base; +} + +void Player::grabdistros() { /* Grab distros: */