mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
RunJump anims + quick fixes
new anims, including RunJump, RunJumpFall and RunJumpBump (incredible name) which play depending on the X velocity the player left the ground with. also fixed the bob-omb to play the kick animation as well as it should also
This commit is contained in:
@@ -24,6 +24,7 @@ func explode() -> void:
|
||||
|
||||
func kick(object: Node2D) -> void:
|
||||
AudioManager.play_sfx("kick", global_position)
|
||||
object.kick_anim()
|
||||
var kick_dir = sign(global_position.x - object.global_position.x)
|
||||
velocity.x = 150 * kick_dir
|
||||
direction = kick_dir
|
||||
|
@@ -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
|
||||
|
||||
@@ -177,6 +178,9 @@ const ANIMATION_FALLBACKS := {
|
||||
"FlyIdle": "SwimIdle",
|
||||
"SwimBump": "Bump",
|
||||
"DieFreeze": "Die",
|
||||
"RunJump": "Jump",
|
||||
"RunJumpFall": "JumpFall",
|
||||
"RunJumpBump": "JumpBump",
|
||||
"StarJump": "Jump",
|
||||
"StarFall": "JumpFall"
|
||||
}
|
||||
@@ -835,6 +839,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
|
||||
|
@@ -222,12 +222,12 @@ func get_animation_name() -> String:
|
||||
elif player.is_actually_on_floor():
|
||||
if abs(player.velocity.x) >= 5 and not player.is_actually_on_wall():
|
||||
return "CrouchMove"
|
||||
elif player.in_water:
|
||||
return "WaterCrouch"
|
||||
elif player.flight_meter > 0:
|
||||
return "WingCrouch"
|
||||
else:
|
||||
return "Crouch"
|
||||
elif player.in_water:
|
||||
return "WaterCrouch"
|
||||
elif player.flight_meter > 0:
|
||||
return "WingCrouch"
|
||||
else:
|
||||
return "Crouch"
|
||||
if player.is_actually_on_floor():
|
||||
if player.skidding:
|
||||
return "Skid"
|
||||
@@ -274,15 +274,24 @@ func get_animation_name() -> String:
|
||||
return "FlyIdle"
|
||||
if player.has_jumped:
|
||||
if player.bumping and player.can_bump_jump:
|
||||
return "JumpBump"
|
||||
if abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
|
||||
return "RunJumpBump"
|
||||
else:
|
||||
return "JumpBump"
|
||||
elif player.velocity.y < 0:
|
||||
if player.is_invincible:
|
||||
return "StarJump"
|
||||
return "Jump"
|
||||
elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
|
||||
return "RunJump"
|
||||
else:
|
||||
return "Jump"
|
||||
else:
|
||||
if player.is_invincible:
|
||||
return "StarFall"
|
||||
return "JumpFall"
|
||||
elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
|
||||
return "RunJumpFall"
|
||||
else:
|
||||
return "JumpFall"
|
||||
else:
|
||||
# guzlad: Fixes characters with fall anims not playing them, but also prevents old characters without that anim not being accurate
|
||||
if !player.sprite.sprite_frames.has_animation("Fall"):
|
||||
|
Reference in New Issue
Block a user