tried to add pathfinding, failed :(
This commit is contained in:
parent
a3833e2e47
commit
1cbf223ad5
11 changed files with 108 additions and 8 deletions
18
Florian/Entity/Animals/cat.tscn
Normal file
18
Florian/Entity/Animals/cat.tscn
Normal file
|
|
@ -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="."]
|
||||||
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
|
@ -3,7 +3,7 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://b3y733ngio1nx"
|
uid="uid://b3y733ngio1nx"
|
||||||
path.s3tc="res://.godot/imported/cat.jpg-63f722852b826a4e9490fdc6ae6fc912.s3tc.ctex"
|
path.s3tc="res://.godot/imported/cat.jpg-c41b6eb35d360ae6506c09482ca4fc62.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
|
|
@ -11,8 +11,8 @@ metadata={
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://Florian/cat.jpg"
|
source_file="res://Florian/Sprites/cat.jpg"
|
||||||
dest_files=["res://.godot/imported/cat.jpg-63f722852b826a4e9490fdc6ae6fc912.s3tc.ctex"]
|
dest_files=["res://.godot/imported/cat.jpg-c41b6eb35d360ae6506c09482ca4fc62.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
BIN
Florian/Sprites/red_circle.png
Normal file
BIN
Florian/Sprites/red_circle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
35
Florian/Sprites/red_circle.png.import
Normal file
35
Florian/Sprites/red_circle.png.import
Normal file
|
|
@ -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
|
||||||
|
|
@ -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="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://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"]
|
[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"]
|
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_a0tk4"]
|
||||||
friction = 0.0
|
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="Node3D" type="Node3D"]
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
|
|
@ -72,3 +82,13 @@ size = Vector3(1, 6, 24)
|
||||||
|
|
||||||
[node name="PointThing" parent="." instance=ExtResource("4_ylvgl")]
|
[node name="PointThing" parent="." instance=ExtResource("4_ylvgl")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 1, 5)
|
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")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
class_name PointPicture
|
class_name PointPicture
|
||||||
extends Node3D
|
extends Node3D
|
||||||
|
|
||||||
|
@onready var red_circle: Sprite3D = $RedCircle
|
||||||
@onready var on_screen: VisibleOnScreenNotifier3D = $VisibleOnScreenNotifier3D
|
@onready var on_screen: VisibleOnScreenNotifier3D = $VisibleOnScreenNotifier3D
|
||||||
@export var points_worth = 10
|
@export var points_worth = 10
|
||||||
@export var point_id = "Debug Object"
|
@export var point_id = "Debug Object"
|
||||||
|
|
@ -8,5 +10,18 @@ func _ready() -> void:
|
||||||
PictureTakeablesArray._add_point_picture(self)
|
PictureTakeablesArray._add_point_picture(self)
|
||||||
|
|
||||||
func picture_taken() -> bool:
|
func picture_taken() -> bool:
|
||||||
print(on_screen.is_on_screen())
|
var in_picture = on_screen.is_on_screen()
|
||||||
return 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()
|
||||||
|
|
|
||||||
|
|
@ -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="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"]
|
[sub_resource type="BoxMesh" id="BoxMesh_hr556"]
|
||||||
|
|
||||||
|
|
@ -11,3 +12,9 @@ script = ExtResource("1_hr556")
|
||||||
mesh = SubResource("BoxMesh_hr556")
|
mesh = SubResource("BoxMesh_hr556")
|
||||||
|
|
||||||
[node name="VisibleOnScreenNotifier3D" type="VisibleOnScreenNotifier3D" parent="."]
|
[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")
|
||||||
|
|
|
||||||
3
pathfinding_array.gd
Normal file
3
pathfinding_array.gd
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var path_3d_array : Array[Path3D] = []
|
||||||
1
pathfinding_array.gd.uid
Normal file
1
pathfinding_array.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://fshpsm6dmwst
|
||||||
|
|
@ -18,6 +18,7 @@ config/icon="res://icon.svg"
|
||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
PictureTakeablesArray="*res://picture_takeables_array.gd"
|
PictureTakeablesArray="*res://picture_takeables_array.gd"
|
||||||
|
PathfindingArray="*res://pathfinding_array.gd"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue