SupaLidlGame/Characters/ExampleEnemy.tscn

200 lines
6.2 KiB
Plaintext

[gd_scene load_steps=26 format=3 uid="uid://bf55wbq7m1gpp"]
[ext_resource type="Script" path="res://Characters/Enemy.cs" id="1_2yopk"]
[ext_resource type="Shader" path="res://Shaders/Flash.gdshader" id="1_fx1w5"]
[ext_resource type="Texture2D" uid="uid://bej8thq7ruyty" path="res://Assets/Sprites/Characters/forsen2.png" id="3_ocaae"]
[ext_resource type="Script" path="res://State/Character/CharacterStateMachine.cs" id="4_424ux"]
[ext_resource type="Script" path="res://State/Character/NPCIdleState.cs" id="5_tn4cf"]
[ext_resource type="Script" path="res://State/Character/NPCMoveState.cs" id="6_73mr6"]
[ext_resource type="PackedScene" uid="uid://cjgxyhgcyvsv7" path="res://BoundingBoxes/Hurtbox.tscn" id="6_jo0cg"]
[ext_resource type="Script" path="res://Items/Inventory.cs" id="7_43gq8"]
[ext_resource type="PackedScene" uid="uid://dvqap2uhcah63" path="res://Items/Weapons/Sword.tscn" id="8_s3c8r"]
[ext_resource type="AudioStream" uid="uid://njun3e6v4854" path="res://Assets/Sounds/hurt.wav" id="10_n1e64"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ms3xg"]
resource_local_to_scene = true
shader = ExtResource("1_fx1w5")
shader_parameter/color = Quaternion(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="Animation" id="Animation_k6l16"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:material:shader_parameter/intensity")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_dxevc"]
resource_name = "hurt"
length = 0.6
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:material:shader_parameter/intensity")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6),
"transitions": PackedFloat32Array(4, 4, 4, 4, 4, 4, 4),
"update": 0,
"values": [0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_xe5eq"]
_data = {
"RESET": SubResource("Animation_k6l16"),
"hurt": SubResource("Animation_dxevc")
}
[sub_resource type="AtlasTexture" id="AtlasTexture_55yt4"]
atlas = ExtResource("3_ocaae")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_xa1bi"]
atlas = ExtResource("3_ocaae")
region = Rect2(24, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_hiodl"]
atlas = ExtResource("3_ocaae")
region = Rect2(48, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_tok7d"]
atlas = ExtResource("3_ocaae")
region = Rect2(72, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_dp8x6"]
atlas = ExtResource("3_ocaae")
region = Rect2(96, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_sglor"]
atlas = ExtResource("3_ocaae")
region = Rect2(120, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_gb41o"]
atlas = ExtResource("3_ocaae")
region = Rect2(144, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_bx6qq"]
atlas = ExtResource("3_ocaae")
region = Rect2(168, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_6pejo"]
resource_local_to_scene = true
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_55yt4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xa1bi")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_hiodl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tok7d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dp8x6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sglor")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gb41o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bx6qq")
}],
"loop": true,
"name": &"move",
"speed": 12.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uict5"]
size = Vector2(16, 8)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8lxmf"]
size = Vector2(16, 18)
[node name="ExampleEnemy" type="CharacterBody2D" node_paths=PackedStringArray("Sprite", "Inventory", "StateMachine", "Hurtbox")]
y_sort_enabled = true
texture_filter = 3
material = SubResource("ShaderMaterial_ms3xg")
collision_layer = 10
collision_mask = 17
script = ExtResource("1_2yopk")
Health = 50.0
Sprite = NodePath("Sprite")
Inventory = NodePath("Inventory")
StateMachine = NodePath("StateMachine")
Hurtbox = NodePath("Hurtbox")
Faction = 2
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("InitialState", "Character")]
script = ExtResource("4_424ux")
InitialState = NodePath("Idle")
Character = NodePath("..")
[node name="Idle" type="Node" parent="StateMachine" node_paths=PackedStringArray("MoveState", "Character")]
script = ExtResource("5_tn4cf")
MoveState = NodePath("../Move")
Character = NodePath("../..")
[node name="Move" type="Node" parent="StateMachine" node_paths=PackedStringArray("IdleState", "Character")]
script = ExtResource("6_73mr6")
IdleState = NodePath("../Idle")
Character = NodePath("../..")
[node name="Animations" type="Node" parent="."]
[node name="HurtAnimation" type="AnimationPlayer" parent="Animations"]
root_node = NodePath("../..")
libraries = {
"": SubResource("AnimationLibrary_xe5eq")
}
[node name="Sprite" type="AnimatedSprite2D" parent="."]
use_parent_material = true
position = Vector2(0, -4)
sprite_frames = SubResource("SpriteFrames_6pejo")
animation = &"move"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 4)
shape = SubResource("RectangleShape2D_uict5")
[node name="Hurtbox" parent="." instance=ExtResource("6_jo0cg")]
position = Vector2(0, -4)
Faction = 2
[node name="CollisionShape2D" parent="Hurtbox" index="0"]
position = Vector2(0, 4)
shape = SubResource("RectangleShape2D_8lxmf")
[node name="Inventory" type="Node2D" parent="."]
y_sort_enabled = true
script = ExtResource("7_43gq8")
[node name="Sword" parent="Inventory" instance=ExtResource("8_s3c8r")]
Knockback = 100.0
[node name="HurtSound" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("10_n1e64")
[editable path="Hurtbox"]