mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-30 23:32:29 +08:00
feat(角色): 添加角色生成时的行走动画
在Chick角色和EntityBase基类中添加spawn方法,用于在角色生成时播放行走动画
This commit is contained in:
@@ -11,6 +11,8 @@ func register():
|
|||||||
attackCooldownMap[0] = 2000
|
attackCooldownMap[0] = 2000
|
||||||
attackCooldownMap[1] = 6000
|
attackCooldownMap[1] = 6000
|
||||||
attackCooldownMap[2] = 100
|
attackCooldownMap[2] = 100
|
||||||
|
func spawn():
|
||||||
|
texture.play("walk")
|
||||||
|
|
||||||
func ai():
|
func ai():
|
||||||
move(currentFocusedBoss.position - position)
|
move(currentFocusedBoss.position - position)
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ func _ready():
|
|||||||
)
|
)
|
||||||
healthChanged.emit(health)
|
healthChanged.emit(health)
|
||||||
energyChanged.emit(energy)
|
energyChanged.emit(energy)
|
||||||
|
spawn()
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
health = clamp(health, 0, fields.get(FieldStore.Entity.MAX_HEALTH))
|
health = clamp(health, 0, fields.get(FieldStore.Entity.MAX_HEALTH))
|
||||||
energy = clamp(energy, 0, fields.get(FieldStore.Entity.MAX_ENERGY))
|
energy = clamp(energy, 0, fields.get(FieldStore.Entity.MAX_ENERGY))
|
||||||
@@ -256,6 +257,8 @@ func heal(count: float):
|
|||||||
return count
|
return count
|
||||||
func register():
|
func register():
|
||||||
pass
|
pass
|
||||||
|
func spawn():
|
||||||
|
pass
|
||||||
|
|
||||||
static func generate(
|
static func generate(
|
||||||
entity: PackedScene,
|
entity: PackedScene,
|
||||||
|
|||||||
Reference in New Issue
Block a user