feat: TEST DAY TEST DAY TEST DAY

This commit is contained in:
Sara 2025-06-02 17:17:49 +02:00
parent 7af00521df
commit 9dca189fa5
38 changed files with 592 additions and 102 deletions

View file

@ -1,7 +1,40 @@
[gd_scene load_steps=2 format=3 uid="uid://dp48t6earfkm4"]
[gd_scene load_steps=6 format=3 uid="uid://dp48t6earfkm4"]
[ext_resource type="PackedScene" uid="uid://cvu7bq8hur8yy" path="res://models/props/evergreen.blend" id="1_xfn5b"]
[ext_resource type="Texture2D" uid="uid://dg6wbdfd7t314" path="res://models/props/evertree_cutout_texture.png" id="2_1mi82"]
[sub_resource type="CylinderMesh" id="CylinderMesh_1mi82"]
top_radius = 0.0
bottom_radius = 10.626
height = 20.987
cap_top = false
[sub_resource type="QuadMesh" id="QuadMesh_plvfv"]
size = Vector2(34.74, 34.74)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bi1ef"]
transparency = 2
alpha_scissor_threshold = 0.709
alpha_antialiasing_mode = 0
shading_mode = 2
specular_mode = 1
albedo_texture = ExtResource("2_1mi82")
disable_receive_shadows = true
billboard_mode = 2
[node name="Evertre" type="Node3D"]
[node name="evergreen" parent="." instance=ExtResource("1_xfn5b")]
visibility_parent = NodePath("../cutout")
[node name="shadowmesh" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 23.702, 0)
cast_shadow = 3
visibility_range_begin = 99.0
mesh = SubResource("CylinderMesh_1mi82")
[node name="cutout" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 17.7955, 0)
visibility_range_begin = 100.0
mesh = SubResource("QuadMesh_plvfv")
surface_material_override/0 = SubResource("StandardMaterial3D_bi1ef")

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://dcgsrdacswacl"]
[gd_scene load_steps=5 format=3 uid="uid://dcgsrdacswacl"]
[ext_resource type="PackedScene" uid="uid://cl7a4q5m73vlw" path="res://models/player/character.blend" id="1_eqqp1"]
[ext_resource type="PackedScene" uid="uid://dy4yl1paa8whs" path="res://ui/ui.tscn" id="2_ykyjo"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bxedw"]
radius = 0.339355
@ -15,7 +16,7 @@ script/source = "extends Camera3D
func _ready():
self.top_level = true
func _process(_delta):
func _physics_process(_delta):
var target : Vector3 = get_parent().global_position + Vector3(0.0, pivot_height, 0.0)
var diff := self.global_position - target
if abs(diff).x + abs(diff.z) > 0.1:
@ -50,4 +51,6 @@ look_target_height = 1.5
[node name="character" parent="." instance=ExtResource("1_eqqp1")]
unique_name_in_owner = true
[node name="CanvasLayer" parent="." instance=ExtResource("2_ykyjo")]
[editable path="character"]

View file

@ -7,11 +7,13 @@
size = Vector2(34.7, 34.7)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t4bw2"]
transparency = 1
transparency = 2
alpha_scissor_threshold = 0.724
alpha_antialiasing_mode = 0
shading_mode = 2
diffuse_mode = 1
specular_mode = 2
specular_mode = 1
albedo_texture = ExtResource("2_t4bw2")
disable_receive_shadows = true
billboard_mode = 2
[sub_resource type="SphereMesh" id="SphereMesh_t4bw2"]
@ -21,15 +23,17 @@ height = 22.768
[node name="Tree" type="Node3D"]
[node name="tree" parent="." instance=ExtResource("1_n3f34")]
visibility_parent = NodePath("../MeshInstance3D")
visibility_parent = NodePath("../cutout")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
[node name="cutout" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 17.1601, 0)
visibility_range_begin = 100.0
mesh = SubResource("QuadMesh_n3f34")
surface_material_override/0 = SubResource("StandardMaterial3D_t4bw2")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 22.6292, 0)
[node name="shadowmesh" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 23.4137, 0)
cast_shadow = 3
visibility_range_begin = 99.0
mesh = SubResource("SphereMesh_t4bw2")
skeleton = NodePath("../tree")

View file

@ -36,10 +36,10 @@ func process_ahead():
var target : Vector3 = player.global_position + last_velocity
target.y = self.global_position.y
var forward : Vector3 = player.velocity.normalized()
if player.global_position.distance_squared_to(self.global_position) < target_distance * target_distance or abs((player.global_position - global_position).dot(forward.cross(Vector3.UP))) < 0.25:
if player.global_position.distance_squared_to(self.global_position) < target_distance * target_distance or abs((player.global_position - global_position).dot(forward.cross(Vector3.UP))) <= 0.1:
self.velocity = Vector3()
return
if !forward.is_zero_approx():
if !forward.is_zero_approx() and false:
last_velocity = player.velocity
forward.y = 0.0
forward = forward.normalized()
@ -47,11 +47,12 @@ func process_ahead():
self.velocity = (target - self.global_position).normalized() * speed
func process_behind():
pass
var diff : Vector3 = player.global_position - global_position
var forward := diff.normalized()
var left := Vector3.UP.cross(forward)
self.velocity = forward + left * direction * min(10.0, diff.length())
self.look_at(Vector3(player.global_position.x, global_position.y, player.global_position.z))
# self.look_at(Vector3(player.global_position.x, global_position.y, player.global_position.z))
func _physics_process(_delta : float):
self.velocity += Vector3(0, -0.25, 0)
@ -59,17 +60,20 @@ func _physics_process(_delta : float):
"
[sub_resource type="SphereShape3D" id="SphereShape3D_j6w7d"]
radius = 1.83616
radius = 1.4143
[sub_resource type="BoxShape3D" id="BoxShape3D_j6w7d"]
size = Vector3(4.29688, 3.86325, 2.76758)
size = Vector3(5.79102, 3.86325, 2.76758)
[node name="WallEnemy" type="CharacterBody3D"]
collision_layer = 2
floor_snap_length = 10.0
script = SubResource("GDScript_j6w7d")
target_distance = 4.0
detect_distance = 20.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83717, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.37512, 0)
shape = SubResource("SphereShape3D_j6w7d")
[node name="AnimatableBody3D" type="AnimatableBody3D" parent="."]