- /* Do butt jump, in case the player has done the combination
- (full jump and hold DOWN) */
- if (input.down == UP && physic.get_velocity_y() == World::current()->get_level()->gravity && butt_jump)
- butt_jump = false; // in case DOWN is not hold after the full jump, disable it
-
- if (input.down == DOWN && butt_jump && on_ground() && size == BIG)
+ /* In case the player has pressed Down while in a certain range of air,
+ enable butt jump action */
+ if (input.down == DOWN && !butt_jump)
+ if(tiles_on_air(TILES_FOR_BUTTJUMP))
+ butt_jump = true;
+
+ /* When Down is not held anymore, disable butt jump */
+ if(butt_jump && input.down == UP)
+ butt_jump = false;
+
+ if (butt_jump && on_ground() && size == BIG)