idk getting back to it
This commit is contained in:
1
entities/npc/NPC.gd
Normal file
1
entities/npc/NPC.gd
Normal file
@@ -0,0 +1 @@
|
||||
class_name NPC extends CharacterBody3D
|
1
entities/npc/NPC.gd.uid
Normal file
1
entities/npc/NPC.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://crw7ls7t8cwct
|
91
entities/npc/NPC.tscn
Normal file
91
entities/npc/NPC.tscn
Normal file
@@ -0,0 +1,91 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://kabs7mopalmo"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://crw7ls7t8cwct" path="res://entities/npc/NPC.gd" id="1_00k55"]
|
||||
[ext_resource type="Script" uid="uid://cmwovncvo1n5o" path="res://entities/npc/NPCTest.gd" id="2_1seh5"]
|
||||
[ext_resource type="Script" uid="uid://b00rxpveu3v4m" path="res://InteractableArea.gd" id="2_x8luf"]
|
||||
[ext_resource type="Texture2D" uid="uid://xx3qp5xh7tgu" path="res://entities/player/Player.png" id="4_x8luf"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_1seh5"]
|
||||
size = Vector3(16, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rl6fg"]
|
||||
atlas = ExtResource("4_x8luf")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q57vx"]
|
||||
atlas = ExtResource("4_x8luf")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ak4un"]
|
||||
atlas = ExtResource("4_x8luf")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1ms0h"]
|
||||
atlas = ExtResource("4_x8luf")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_1seh5"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rl6fg")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_east",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_q57vx")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_north",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ak4un")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_south",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1ms0h")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_west",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_x8luf"]
|
||||
radius = 8.5
|
||||
|
||||
[node name="NPC" type="CharacterBody3D"]
|
||||
script = ExtResource("1_00k55")
|
||||
|
||||
[node name="Scripts" type="Node" parent="."]
|
||||
|
||||
[node name="NPCTest" type="Node" parent="Scripts"]
|
||||
script = ExtResource("2_1seh5")
|
||||
|
||||
[node name="InteractableArea" type="Area3D" parent="."]
|
||||
script = ExtResource("2_x8luf")
|
||||
metadata/_custom_type_script = "uid://b00rxpveu3v4m"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractableArea"]
|
||||
shape = SubResource("BoxShape3D_1seh5")
|
||||
|
||||
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]
|
||||
pixel_size = 1.0
|
||||
billboard = 1
|
||||
double_sided = false
|
||||
texture_filter = 0
|
||||
sprite_frames = SubResource("SpriteFrames_1seh5")
|
||||
animation = &"walk_west"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("SphereShape3D_x8luf")
|
||||
|
||||
[connection signal="interactEvent" from="InteractableArea" to="Scripts/NPCTest" method="onInteract"]
|
5
entities/npc/NPCTest.gd
Normal file
5
entities/npc/NPCTest.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
class_name NPCTest extends Node
|
||||
|
||||
func onInteract(playerEntity: Player) -> void:
|
||||
print("Player has interacted with the NPC.")
|
||||
UI.TEXTBOX.setText("You have interacted with the NPC.")
|
1
entities/npc/NPCTest.gd.uid
Normal file
1
entities/npc/NPCTest.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cmwovncvo1n5o
|
Reference in New Issue
Block a user