diff --git a/Florian/Entity/Animals/cat.tscn b/Florian/Entity/Animals/cat.tscn new file mode 100644 index 0000000..11406b8 --- /dev/null +++ b/Florian/Entity/Animals/cat.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=4 format=3 uid="uid://xa3ee14whqj6"] + +[ext_resource type="PackedScene" uid="uid://c8gnb0kut2n5h" path="res://Florian/point_thing.tscn" id="1_ths60"] +[ext_resource type="Texture2D" uid="uid://b3y733ngio1nx" path="res://Florian/Sprites/cat.jpg" id="2_f6meo"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_vea6b"] + +[node name="Cat" type="RigidBody3D"] + +[node name="PointThing" parent="." instance=ExtResource("1_ths60")] + +[node name="Sprite3D" type="Sprite3D" parent="."] +texture = ExtResource("2_f6meo") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("CapsuleShape3D_vea6b") + +[node name="PathFollow3D" type="PathFollow3D" parent="."] diff --git a/Florian/cat.jpg b/Florian/Sprites/cat.jpg similarity index 100% rename from Florian/cat.jpg rename to Florian/Sprites/cat.jpg diff --git a/Florian/cat.jpg.import b/Florian/Sprites/cat.jpg.import similarity index 73% rename from Florian/cat.jpg.import rename to Florian/Sprites/cat.jpg.import index 9e3c7a0..6a3fd0f 100644 --- a/Florian/cat.jpg.import +++ b/Florian/Sprites/cat.jpg.import @@ -3,7 +3,7 @@ importer="texture" type="CompressedTexture2D" uid="uid://b3y733ngio1nx" -path.s3tc="res://.godot/imported/cat.jpg-63f722852b826a4e9490fdc6ae6fc912.s3tc.ctex" +path.s3tc="res://.godot/imported/cat.jpg-c41b6eb35d360ae6506c09482ca4fc62.s3tc.ctex" metadata={ "imported_formats": ["s3tc_bptc"], "vram_texture": true @@ -11,8 +11,8 @@ metadata={ [deps] -source_file="res://Florian/cat.jpg" -dest_files=["res://.godot/imported/cat.jpg-63f722852b826a4e9490fdc6ae6fc912.s3tc.ctex"] +source_file="res://Florian/Sprites/cat.jpg" +dest_files=["res://.godot/imported/cat.jpg-c41b6eb35d360ae6506c09482ca4fc62.s3tc.ctex"] [params] diff --git a/Florian/Sprites/red_circle.png b/Florian/Sprites/red_circle.png new file mode 100644 index 0000000..2ba670b Binary files /dev/null and b/Florian/Sprites/red_circle.png differ diff --git a/Florian/Sprites/red_circle.png.import b/Florian/Sprites/red_circle.png.import new file mode 100644 index 0000000..4d3eb68 --- /dev/null +++ b/Florian/Sprites/red_circle.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpqf3a8f2fp7q" +path.s3tc="res://.godot/imported/red_circle.png-9b2f9a11caf156c000fd1466bacd9c77.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://Florian/Sprites/red_circle.png" +dest_files=["res://.godot/imported/red_circle.png-9b2f9a11caf156c000fd1466bacd9c77.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/Florian/node_3d.tscn b/Florian/node_3d.tscn index 8d45389..1ff2e09 100644 --- a/Florian/node_3d.tscn +++ b/Florian/node_3d.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=9 format=3 uid="uid://d1rip77vefx3i"] +[gd_scene load_steps=11 format=3 uid="uid://d1rip77vefx3i"] -[ext_resource type="Texture2D" uid="uid://b3y733ngio1nx" path="res://Florian/cat.jpg" id="1_a202f"] +[ext_resource type="Texture2D" uid="uid://b3y733ngio1nx" path="res://Florian/Sprites/cat.jpg" id="1_a202f"] [ext_resource type="Script" uid="uid://bc47hy67mfo7v" path="res://Florian/sprite_3d.gd" id="2_a0tk4"] [ext_resource type="PackedScene" uid="uid://crrco762ow56c" path="res://Florian/PlayerRigidbody.tscn" id="2_noarx"] [ext_resource type="PackedScene" uid="uid://c8gnb0kut2n5h" path="res://Florian/point_thing.tscn" id="4_ylvgl"] @@ -17,6 +17,16 @@ size = Vector2(500, 500) [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_a0tk4"] friction = 0.0 +[sub_resource type="Curve3D" id="Curve3D_ylvgl"] +closed = true +_data = { +"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, -45, 0, 0, 0, 0, 0, 0, 32.3104, 0.419155, -45.9028, 0, 0, 0, 0, 0, 0, 30.015, 0, 1.125, 0, 0, 0, 0, 0, 0, -3.95776, 3.97149, -6.58477), +"tilts": PackedFloat32Array(0, 0, 0, 0) +} +point_count = 4 + +[sub_resource type="NavigationMesh" id="NavigationMesh_ylvgl"] + [node name="Node3D" type="Node3D"] [node name="MeshInstance3D" type="MeshInstance3D" parent="."] @@ -72,3 +82,13 @@ size = Vector3(1, 6, 24) [node name="PointThing" parent="." instance=ExtResource("4_ylvgl")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 1, 5) + +[node name="AI" type="Node3D" parent="."] + +[node name="Path3D" type="Path3D" parent="AI"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -16, 0, 0) +curve = SubResource("Curve3D_ylvgl") + +[node name="NavigationRegion3D" type="NavigationRegion3D" parent="AI"] +transform = Transform3D(2.1, 0, 0, 0, 2.1, 0, 0, 0, 2.1, -15, 0, 0) +navigation_mesh = SubResource("NavigationMesh_ylvgl") diff --git a/Florian/point_thing.gd b/Florian/point_thing.gd index d99e64e..8711a15 100644 --- a/Florian/point_thing.gd +++ b/Florian/point_thing.gd @@ -1,5 +1,7 @@ class_name PointPicture extends Node3D + +@onready var red_circle: Sprite3D = $RedCircle @onready var on_screen: VisibleOnScreenNotifier3D = $VisibleOnScreenNotifier3D @export var points_worth = 10 @export var point_id = "Debug Object" @@ -8,5 +10,18 @@ func _ready() -> void: PictureTakeablesArray._add_point_picture(self) func picture_taken() -> bool: - print(on_screen.is_on_screen()) - return on_screen.is_on_screen() + var in_picture = on_screen.is_on_screen() + print(in_picture) + if in_picture: + show_red_cicle() + else: + hide_red_circle() + return in_picture + +func show_red_cicle(): + print("Showing red circle") + red_circle.show() + +func hide_red_circle(): + print("Hiding red circle") + red_circle.hide() diff --git a/Florian/point_thing.tscn b/Florian/point_thing.tscn index cbd4b66..dd5fabb 100644 --- a/Florian/point_thing.tscn +++ b/Florian/point_thing.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=3 uid="uid://c8gnb0kut2n5h"] +[gd_scene load_steps=4 format=3 uid="uid://c8gnb0kut2n5h"] [ext_resource type="Script" uid="uid://cyw0eu5pqd3wm" path="res://Florian/point_thing.gd" id="1_hr556"] +[ext_resource type="Texture2D" uid="uid://bpqf3a8f2fp7q" path="res://Florian/Sprites/red_circle.png" id="2_wfrpx"] [sub_resource type="BoxMesh" id="BoxMesh_hr556"] @@ -11,3 +12,9 @@ script = ExtResource("1_hr556") mesh = SubResource("BoxMesh_hr556") [node name="VisibleOnScreenNotifier3D" type="VisibleOnScreenNotifier3D" parent="."] + +[node name="RedCircle" type="Sprite3D" parent="."] +transform = Transform3D(0.16, 0, 0, 0, 0.16, 0, 0, 0, 0.16, 0, 0, 0) +visible = false +billboard = 2 +texture = ExtResource("2_wfrpx") diff --git a/pathfinding_array.gd b/pathfinding_array.gd new file mode 100644 index 0000000..ff0b8d4 --- /dev/null +++ b/pathfinding_array.gd @@ -0,0 +1,3 @@ +extends Node + +@export var path_3d_array : Array[Path3D] = [] diff --git a/pathfinding_array.gd.uid b/pathfinding_array.gd.uid new file mode 100644 index 0000000..d908da0 --- /dev/null +++ b/pathfinding_array.gd.uid @@ -0,0 +1 @@ +uid://fshpsm6dmwst diff --git a/project.godot b/project.godot index db2b010..271e28f 100644 --- a/project.godot +++ b/project.godot @@ -18,6 +18,7 @@ config/icon="res://icon.svg" [autoload] PictureTakeablesArray="*res://picture_takeables_array.gd" +PathfindingArray="*res://pathfinding_array.gd" [input]