mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-24 08:20:50 +00:00
Merge branch 'main' into custom-level-loading-rewrite
This commit is contained in:
@@ -52,6 +52,7 @@ var input_direction := 0
|
||||
var flight_meter := 0.0
|
||||
|
||||
var velocity_direction := 1
|
||||
var velocity_x_jump_stored := 0
|
||||
|
||||
var total_keys := 0
|
||||
|
||||
@@ -74,6 +75,9 @@ var can_bump_crouch = false
|
||||
var can_bump_swim = false
|
||||
var can_bump_fly = false
|
||||
|
||||
var kicking = false
|
||||
var can_kick_anim = false
|
||||
|
||||
@export var player_id := 0
|
||||
const ONE_UP_NOTE = preload("uid://dopxwjj37gu0l")
|
||||
var gravity := FALL_GRAVITY
|
||||
@@ -146,31 +150,39 @@ const ANIMATION_FALLBACKS := {
|
||||
"Pipe": "Idle",
|
||||
"Walk": "Move",
|
||||
"Run": "Move",
|
||||
"PipeWalk": "Move",
|
||||
"PipeWalk": "Walk",
|
||||
"LookUp": "Idle",
|
||||
"WaterLookUp": "LookUp",
|
||||
"WingLookUp": "WaterLookUp",
|
||||
"Crouch": "Idle",
|
||||
"WaterCrouch": "Crouch",
|
||||
"WingCrouch": "WaterCrouch",
|
||||
"CrouchFall": "Crouch",
|
||||
"CrouchJump": "Crouch",
|
||||
"CrouchBump": "Bump",
|
||||
"CrouchMove": "Crouch",
|
||||
"IdleAttack": "Attack",
|
||||
"IdleAttack": "MoveAttack",
|
||||
"CrouchAttack": "IdleAttack",
|
||||
"MoveAttack": "IdleAttack",
|
||||
"MoveAttack": "Attack",
|
||||
"WalkAttack": "MoveAttack",
|
||||
"RunAttack": "MoveAttack",
|
||||
"SkidAttack": "MoveAttack",
|
||||
"FlyIdle": "SwimIdle",
|
||||
"WingIdle": "WaterIdle",
|
||||
"FlyUp": "SwimUp",
|
||||
"FlyMove": "SwimMove",
|
||||
"WingMove": "WaterMove",
|
||||
"FlyAttack": "SwimAttack",
|
||||
"FlyBump": "SwimBump",
|
||||
"FlagSlide": "Climb",
|
||||
"WaterMove": "Move",
|
||||
"WaterIdle": "Idle",
|
||||
"FlyIdle": "SwimIdle",
|
||||
"SwimBump": "Bump",
|
||||
"DieFreeze": "Die",
|
||||
"RunJump": "Jump",
|
||||
"RunJumpFall": "JumpFall",
|
||||
"RunJumpBump": "JumpBump",
|
||||
"StarJump": "Jump",
|
||||
"StarFall": "StarJump"
|
||||
"StarFall": "JumpFall"
|
||||
}
|
||||
|
||||
var palette_transform := true
|
||||
@@ -270,6 +282,7 @@ func _physics_process(delta: float) -> void:
|
||||
set_power_state_frame()
|
||||
if Input.is_action_just_pressed("debug_noclip") and Global.debug_mode:
|
||||
state_machine.transition_to("NoClip")
|
||||
Global.log_comment("NOCLIP Enabled")
|
||||
up_direction = -gravity_vector
|
||||
handle_directions()
|
||||
handle_block_collision_detection()
|
||||
@@ -317,6 +330,7 @@ func _process(delta: float) -> void:
|
||||
if is_invincible:
|
||||
DiscoLevel.combo_meter = 100
|
||||
%Hammer.visible = has_hammer
|
||||
%HammerHitbox.collision_layer = has_hammer
|
||||
|
||||
func apply_gravity(delta: float) -> void:
|
||||
if in_water or flight_meter > 0:
|
||||
@@ -448,6 +462,11 @@ func bump_ceiling() -> void:
|
||||
await get_tree().create_timer(0.1).timeout
|
||||
bumping = false
|
||||
|
||||
func kick_anim() -> void:
|
||||
kicking = true
|
||||
await get_tree().create_timer(0.2).timeout
|
||||
kicking = false
|
||||
|
||||
func super_star() -> void:
|
||||
DiscoLevel.combo_meter += 1
|
||||
is_invincible = true
|
||||
@@ -670,6 +689,7 @@ func set_power_state_frame() -> void:
|
||||
can_bump_crouch = %Sprite.sprite_frames.has_animation("CrouchBump")
|
||||
can_bump_swim = %Sprite.sprite_frames.has_animation("SwimBump")
|
||||
can_bump_fly = %Sprite.sprite_frames.has_animation("FlyBump")
|
||||
can_kick_anim = %Sprite.sprite_frames.has_animation("Kick")
|
||||
|
||||
func get_power_up(power_name := "") -> void:
|
||||
if is_dead:
|
||||
@@ -796,7 +816,7 @@ func hide_pipe_animation() -> void:
|
||||
func go_to_exit_pipe(pipe: PipeArea) -> void:
|
||||
Global.can_time_tick = false
|
||||
pipe_enter_direction = Vector2.ZERO
|
||||
state_machine.transition_to("Pipe")
|
||||
state_machine.transition_to("Freeze")
|
||||
global_position = pipe.global_position + (pipe.get_vector(pipe.enter_direction) * 32)
|
||||
if pipe.enter_direction == 1:
|
||||
global_position = pipe.global_position + Vector2(0, -8)
|
||||
@@ -821,6 +841,7 @@ func jump() -> void:
|
||||
if spring_bouncing:
|
||||
return
|
||||
velocity.y = calculate_jump_height() * gravity_vector.y
|
||||
velocity_x_jump_stored = velocity.x
|
||||
gravity = JUMP_GRAVITY
|
||||
AudioManager.play_sfx("small_jump" if power_state.hitbox_size == "Small" else "big_jump", global_position)
|
||||
has_jumped = true
|
||||
@@ -873,9 +894,6 @@ func hammer_get() -> void:
|
||||
$HammerTimer.start()
|
||||
AudioManager.set_music_override(AudioManager.MUSIC_OVERRIDES.HAMMER, 0, false)
|
||||
|
||||
func on_hammer_area_entered(area: Area2D) -> void:
|
||||
pass
|
||||
|
||||
func wing_get() -> void:
|
||||
AudioManager.set_music_override(AudioManager.MUSIC_OVERRIDES.WING, 0, false, false)
|
||||
flight_meter = 10
|
||||
|
||||
Reference in New Issue
Block a user