Compare commits

...

2 Commits

Author SHA1 Message Date
Spencer Killen c4a3b3bdc0
a 2023-08-19 20:56:23 -06:00
Spencer Killen 429b91facf
villager animations 2023-08-19 20:45:30 -06:00
3 changed files with 9 additions and 10 deletions

View File

@ -16,9 +16,9 @@
[ext_resource type="PackedScene" uid="uid://bf6bbqbaeh21y" path="res://Models/rocks/rock_3.tscn" id="14_1ahqw"] [ext_resource type="PackedScene" uid="uid://bf6bbqbaeh21y" path="res://Models/rocks/rock_3.tscn" id="14_1ahqw"]
[ext_resource type="PackedScene" uid="uid://bj8le45u845v3" path="res://Models/beach_decor/floatie.tscn" id="15_2v7p7"] [ext_resource type="PackedScene" uid="uid://bj8le45u845v3" path="res://Models/beach_decor/floatie.tscn" id="15_2v7p7"]
[ext_resource type="PackedScene" uid="uid://dhrnbubumgi5h" path="res://Models/buildings/buildingruined.tscn" id="15_6cbuu"] [ext_resource type="PackedScene" uid="uid://dhrnbubumgi5h" path="res://Models/buildings/buildingruined.tscn" id="15_6cbuu"]
[ext_resource type="PackedScene" uid="uid://bgoo1lbt28na" path="res://Models/grape_man.tscn" id="21_5uj16"]
[ext_resource type="PackedScene" uid="uid://dvpank15vkvtv" path="res://Models/beach_decor/parsol.tscn" id="21_dlhqg"] [ext_resource type="PackedScene" uid="uid://dvpank15vkvtv" path="res://Models/beach_decor/parsol.tscn" id="21_dlhqg"]
[ext_resource type="PackedScene" uid="uid://c3q6fva1c1baa" path="res://Models/slime.tscn" id="22_5oom1"] [ext_resource type="PackedScene" uid="uid://c4s6y758n77lw" path="res://villager_shared.tscn" id="21_hxwg1"]
[ext_resource type="PackedScene" uid="uid://7utef1nnena8" path="res://player.tscn" id="22_cuxj6"]
[ext_resource type="PackedScene" uid="uid://b3aus2kigf8xt" path="res://Models/beach_decor/cooler.tscn" id="24_sl7ne"] [ext_resource type="PackedScene" uid="uid://b3aus2kigf8xt" path="res://Models/beach_decor/cooler.tscn" id="24_sl7ne"]
[ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"] [ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"]
[ext_resource type="PackedScene" uid="uid://g4gmc0pwlak1" path="res://Models/buildings/fence.tscn" id="28_prydb"] [ext_resource type="PackedScene" uid="uid://g4gmc0pwlak1" path="res://Models/buildings/fence.tscn" id="28_prydb"]
@ -245,11 +245,8 @@ transform = Transform3D(-6.55671e-08, 0, -1.5, 0, 1.5, 0, 1.5, 0, -6.55671e-08,
[node name="fence4" parent="Decorations/slimepen" instance=ExtResource("28_prydb")] [node name="fence4" parent="Decorations/slimepen" instance=ExtResource("28_prydb")]
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 1.40507, -2.10425) transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 1.40507, -2.10425)
[node name="grape_man" parent="." instance=ExtResource("21_5uj16")] [node name="villager" parent="." instance=ExtResource("21_hxwg1")]
transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, -0.219532, 2.64323, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.369429, 2.40957, -0.685529)
[node name="slime" parent="." instance=ExtResource("22_5oom1")] [node name="Player" parent="." instance=ExtResource("22_cuxj6")]
transform = Transform3D(0.035, 0, 0, 0, 0.035, 0, 0, 0, 0.035, -0.240886, 2.72271, 0.267039) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.192051, 2.60275, 0)
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.965509, 0.26037, 0, -0.26037, 0.965509, 0, 5.42228, 4.14616)

View File

@ -113,6 +113,6 @@ func _on_holster_enter(body):
target = weakref(body) target = weakref(body)
func _on_holster_exit(body): func _on_holster_exit(body):
if target.get_ref() or holding.get_ref() or "is_holdable" not in body: if not target.get_ref() or holding.get_ref() or "is_holdable" not in body:
return return
target = weakref(null) target = weakref(null)

View File

@ -34,6 +34,7 @@ func _process(_delta):
match task: match task:
"idle": "idle":
idle()
task = rng.randf_range(0, 100) task = rng.randf_range(0, 100)
# 3% chance to walk somewhere. # 3% chance to walk somewhere.
@ -51,6 +52,7 @@ func _process(_delta):
task = "idle" task = "idle"
"walk": "walk":
walk()
# Get the direction to the target in z-x plane. # Get the direction to the target in z-x plane.
target_direction_xz = (location_xz.direction_to(target_location_xz) * Vector3(1, 0, 1)).normalized() target_direction_xz = (location_xz.direction_to(target_location_xz) * Vector3(1, 0, 1)).normalized()