mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-12-06 03:30:22 -08:00
Fix to prevent entering pipes from too low
this implements a simple distance check from the player to the hitbox to ensure the player can only ever enter the pipe when they're close enough in proximity to the pipe, preventing them from entering from a tile too low.
This commit is contained in:
parent
07e68d7bf7
commit
9fd858811f
1 changed files with 2 additions and 1 deletions
|
|
@ -114,7 +114,8 @@ func in_game() -> void:
|
||||||
|
|
||||||
func run_player_check(player: Player) -> void:
|
func run_player_check(player: Player) -> void:
|
||||||
# guzlad: Added support for characters with a hitbox height below 1.0 to enter pipes underwater
|
# guzlad: Added support for characters with a hitbox height below 1.0 to enter pipes underwater
|
||||||
if Global.player_action_pressed(get_input_direction(enter_direction), player.player_id) and (player.is_actually_on_floor() or enter_direction == 1):
|
var distance = player.global_position.distance_to(hitbox.global_position)
|
||||||
|
if distance <= 6 and Global.player_action_pressed(get_input_direction(enter_direction), player.player_id) and (player.is_actually_on_floor() or enter_direction == 1):
|
||||||
can_enter = false
|
can_enter = false
|
||||||
pipe_entered.emit()
|
pipe_entered.emit()
|
||||||
DiscoLevel.can_meter_tick = false
|
DiscoLevel.can_meter_tick = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue