Fixing Ghost Enemy

This commit is contained in:
Jasmine Hyder
2021-12-04 19:52:58 -06:00
parent 5a3ae103f5
commit fae11f8d95
8 changed files with 274 additions and 36 deletions

View File

@@ -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")