Add combat combo gameplay

This commit is contained in:
wxm
2026-07-02 05:11:24 -07:00
parent 8c0c5e5067
commit 67db812de4
32 changed files with 3297 additions and 205 deletions

View File

@@ -1,6 +1,20 @@
extends SceneTree
var failures: Array[String] = []
const PLAYER_SPRITE_ANCHOR := Vector2(-40, -48)
const WARRIOR_ANIMATIONS := [
"warrior_idle",
"warrior_w",
"warrior_wa",
"warrior_s",
"warrior_a",
"warrior_aa",
"warrior_aaa",
"warrior_charge_release",
"warrior_s_projectile",
"warrior_a_space_space",
"warrior_a_space",
]
func _init() -> void:
@@ -18,14 +32,13 @@ func _init() -> void:
_expect_vector((player as Node2D).scale, Vector2(4, 4), "Player root scale")
_expect_vector(sprite.scale, Vector2.ONE, "CharacterSprite local scale should keep anchor")
_expect_vector(sprite.offset, Vector2(-24, -40), "CharacterSprite visible foot offset")
_expect_vector(sprite.offset, PLAYER_SPRITE_ANCHOR, "CharacterSprite visible foot offset")
_expect_vector(collision.scale, Vector2.ONE, "CollisionShape2D local scale should keep anchor")
_expect_vector(collision.position, Vector2(0, -18), "CollisionShape2D local position should keep anchor")
_expect_vector(camera.position, Vector2(0, -37.5), "Camera2D position should compensate player scale")
_expect_vector(camera.scale, Vector2(0.25, 0.25), "Camera2D scale should compensate player scale")
_expect_animation_offset(animation_player, "idle", Vector2(-24, -40))
_expect_animation_offset(animation_player, "jump", Vector2(-24, -44))
_expect_animation_offset(animation_player, "挥砍", Vector2(-40, -48))
for animation_name: String in WARRIOR_ANIMATIONS:
_expect_animation_offset(animation_player, animation_name, PLAYER_SPRITE_ANCHOR)
player.free()