Ms.X now plays the give animation when spawning a shard
This commit is contained in:
parent
1ae04b7368
commit
84c92ac4b7
2 changed files with 23 additions and 8 deletions
|
@ -21,7 +21,7 @@ func _physics_process(delta):
|
|||
velocity = move_and_slide_with_snap(velocity, Vector2.DOWN, Vector2.UP, true)
|
||||
#Anims
|
||||
if velocity.x == 0:
|
||||
anims.play("idle")
|
||||
if !anims.get_current_animation() == "give": anims.play("idle")
|
||||
else:
|
||||
anims.play("walk")
|
||||
#Stop at the end of path and give shard
|
||||
|
@ -30,13 +30,14 @@ func _physics_process(delta):
|
|||
velocity.x = 0
|
||||
if is_holding_shard:
|
||||
anims.play("give")
|
||||
var ShardInstance = shard.instance()
|
||||
ShardInstance.global_position = Vector2(shard_position.global_position.x,shard_position.global_position.y)
|
||||
ShardInstance.number = 1
|
||||
get_owner().add_child(ShardInstance)
|
||||
is_holding_shard = false
|
||||
|
||||
|
||||
func spawn_shard():
|
||||
var ShardInstance = shard.instance()
|
||||
ShardInstance.global_position = Vector2(shard_position.global_position.x,shard_position.global_position.y)
|
||||
ShardInstance.number = 1
|
||||
get_owner().add_child(ShardInstance)
|
||||
is_holding_shard = false
|
||||
|
||||
func switch_action():
|
||||
is_moving = true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue