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:
SkyanUltra
2025-10-14 05:59:16 -04:00
parent a7589e0870
commit 6773a5a093
3 changed files with 24 additions and 9 deletions

View File

@@ -24,6 +24,7 @@ func explode() -> void:
func kick(object: Node2D) -> void: func kick(object: Node2D) -> void:
AudioManager.play_sfx("kick", global_position) AudioManager.play_sfx("kick", global_position)
object.kick_anim()
var kick_dir = sign(global_position.x - object.global_position.x) var kick_dir = sign(global_position.x - object.global_position.x)
velocity.x = 150 * kick_dir velocity.x = 150 * kick_dir
direction = kick_dir direction = kick_dir

View File

@@ -52,6 +52,7 @@ var input_direction := 0
var flight_meter := 0.0 var flight_meter := 0.0
var velocity_direction := 1 var velocity_direction := 1
var velocity_x_jump_stored := 0
var total_keys := 0 var total_keys := 0
@@ -177,6 +178,9 @@ const ANIMATION_FALLBACKS := {
"FlyIdle": "SwimIdle", "FlyIdle": "SwimIdle",
"SwimBump": "Bump", "SwimBump": "Bump",
"DieFreeze": "Die", "DieFreeze": "Die",
"RunJump": "Jump",
"RunJumpFall": "JumpFall",
"RunJumpBump": "JumpBump",
"StarJump": "Jump", "StarJump": "Jump",
"StarFall": "JumpFall" "StarFall": "JumpFall"
} }
@@ -835,6 +839,7 @@ func jump() -> void:
if spring_bouncing: if spring_bouncing:
return return
velocity.y = calculate_jump_height() * gravity_vector.y velocity.y = calculate_jump_height() * gravity_vector.y
velocity_x_jump_stored = velocity.x
gravity = JUMP_GRAVITY gravity = JUMP_GRAVITY
AudioManager.play_sfx("small_jump" if power_state.hitbox_size == "Small" else "big_jump", global_position) AudioManager.play_sfx("small_jump" if power_state.hitbox_size == "Small" else "big_jump", global_position)
has_jumped = true has_jumped = true

View File

@@ -274,14 +274,23 @@ func get_animation_name() -> String:
return "FlyIdle" return "FlyIdle"
if player.has_jumped: if player.has_jumped:
if player.bumping and player.can_bump_jump: if player.bumping and player.can_bump_jump:
if abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
return "RunJumpBump"
else:
return "JumpBump" return "JumpBump"
elif player.velocity.y < 0: elif player.velocity.y < 0:
if player.is_invincible: if player.is_invincible:
return "StarJump" return "StarJump"
elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
return "RunJump"
else:
return "Jump" return "Jump"
else: else:
if player.is_invincible: if player.is_invincible:
return "StarFall" return "StarFall"
elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
return "RunJumpFall"
else:
return "JumpFall" return "JumpFall"
else: else:
# guzlad: Fixes characters with fall anims not playing them, but also prevents old characters without that anim not being accurate # guzlad: Fixes characters with fall anims not playing them, but also prevents old characters without that anim not being accurate