mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
fixed frame 1 water jumping
This commit is contained in:
@@ -240,11 +240,7 @@ func _physics_process(delta: float) -> void:
|
|||||||
stomp_combo = 0
|
stomp_combo = 0
|
||||||
elif velocity.y > 15:
|
elif velocity.y > 15:
|
||||||
can_bump_sfx = true
|
can_bump_sfx = true
|
||||||
var old_water = in_water
|
handle_water_detection()
|
||||||
if $Hitbox.monitoring:
|
|
||||||
in_water = $Hitbox.get_overlapping_areas().any(func(area: Area2D): return area is WaterArea) or $WaterDetect.get_overlapping_bodies().is_empty() == false
|
|
||||||
if old_water != in_water and in_water == false and flight_meter <= 0:
|
|
||||||
water_exited()
|
|
||||||
if $SkidSFX.playing:
|
if $SkidSFX.playing:
|
||||||
if (is_actually_on_floor() and skidding) == false:
|
if (is_actually_on_floor() and skidding) == false:
|
||||||
$SkidSFX.stop()
|
$SkidSFX.stop()
|
||||||
@@ -253,6 +249,13 @@ func _physics_process(delta: float) -> void:
|
|||||||
|
|
||||||
const BUBBLE_PARTICLE = preload("uid://bwjae1h1airtr")
|
const BUBBLE_PARTICLE = preload("uid://bwjae1h1airtr")
|
||||||
|
|
||||||
|
func handle_water_detection() -> void:
|
||||||
|
var old_water = in_water
|
||||||
|
if $Hitbox.monitoring:
|
||||||
|
in_water = $Hitbox.get_overlapping_areas().any(func(area: Area2D): return area is WaterArea) or $WaterDetect.get_overlapping_bodies().is_empty() == false
|
||||||
|
if old_water != in_water and in_water == false and flight_meter <= 0:
|
||||||
|
water_exited()
|
||||||
|
|
||||||
func summon_bubble() -> void:
|
func summon_bubble() -> void:
|
||||||
var bubble = BUBBLE_PARTICLE.instantiate()
|
var bubble = BUBBLE_PARTICLE.instantiate()
|
||||||
bubble.global_position = global_position + Vector2(0, -16 if power_state.hitbox_size == "Small" else -32)
|
bubble.global_position = global_position + Vector2(0, -16 if power_state.hitbox_size == "Small" else -32)
|
||||||
|
@@ -54,6 +54,7 @@ func grounded(delta: float) -> void:
|
|||||||
if player.velocity.y >= 0:
|
if player.velocity.y >= 0:
|
||||||
player.has_jumped = false
|
player.has_jumped = false
|
||||||
if Global.player_action_just_pressed("jump", player.player_id):
|
if Global.player_action_just_pressed("jump", player.player_id):
|
||||||
|
player.handle_water_detection()
|
||||||
if player.in_water or player.flight_meter > 0:
|
if player.in_water or player.flight_meter > 0:
|
||||||
swim_up()
|
swim_up()
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user