Trying to add new enemy

This commit is contained in:
Jasmine
2021-12-04 17:54:29 -06:00
parent 1e8a8a15f8
commit 5a3ae103f5
20 changed files with 865 additions and 120 deletions

16
Enemies/Ghost_Enemy.gd Normal file
View File

@@ -0,0 +1,16 @@
extends KinematicBody2D
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
onready var animation_player: AnimationPlayer = get_node("AnimationPlayer")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
animation_player.play("appear")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

38
Enemies/Ghost_Enemy.tscn Normal file
View File

@@ -0,0 +1,38 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Enemies/Ghost_Enemy.gd" type="Script" id=5]
[sub_resource type="Animation" id=1]
resource_name = "appear"
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( ),
"transitions": PoolRealArray( ),
"update": 1,
"values": [ ]
}
[sub_resource type="Animation" id=3]
resource_name = "idle"
length = 4.0
step = 0.6
[sub_resource type="CircleShape2D" id=28]
radius = 28.3009
[node name="KinematicBody2D" type="KinematicBody2D"]
script = ExtResource( 5 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/appear = SubResource( 1 )
anims/idle = SubResource( 3 )
[node name="Sprite" type="Sprite" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 28 )

View File

@@ -256,6 +256,6 @@ animations = [ {
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 56 )
animation = "attack"
frame = 11
animation = "running"
frame = 4
playing = true