Fixing Ghost Enemy
This commit is contained in:
@@ -1,16 +1,26 @@
|
||||
extends KinematicBody2D
|
||||
extends Node2D
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a: int = 2
|
||||
# var b: String = "text"
|
||||
onready var animation_player: AnimationPlayer = get_node("AnimationPlayer")
|
||||
onready var animated_sprite = $AnimatedSprite
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
animation_player.play("appear")
|
||||
self.visible = false
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta: float) -> void:
|
||||
# pass
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
#animated_sprite.play("idle")
|
||||
|
||||
|
||||
func _on_Area2D_body_entered(body):
|
||||
self.visible = true
|
||||
animated_sprite.play("appear")
|
||||
|
||||
|
||||
func _on_AnimatedSprite_animation_finished():
|
||||
animated_sprite.play("idle")
|
||||
|
Reference in New Issue
Block a user