feat: Rotate arrow to point at station

This commit is contained in:
Dusk 2026-03-06 09:35:24 +01:00
parent 80f268d536
commit 125cb3fdb0
6 changed files with 23 additions and 12 deletions

View File

@ -3,19 +3,20 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://bpfvioqm4kbv8" uid="uid://bpfvioqm4kbv8"
path="res://.godot/imported/arrow.png-9053f2b1a9a256ad0bb19fe69a4c452c.ctex" path.s3tc="res://.godot/imported/arrow.png-9053f2b1a9a256ad0bb19fe69a4c452c.s3tc.ctex"
metadata={ metadata={
"vram_texture": false "imported_formats": ["s3tc_bptc"],
"vram_texture": true
} }
[deps] [deps]
source_file="res://assets/Images/arrow.png" source_file="res://assets/Images/arrow.png"
dest_files=["res://.godot/imported/arrow.png-9053f2b1a9a256ad0bb19fe69a4c452c.ctex"] dest_files=["res://.godot/imported/arrow.png-9053f2b1a9a256ad0bb19fe69a4c452c.s3tc.ctex"]
[params] [params]
compress/mode=0 compress/mode=2
compress/high_quality=false compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/uastc_level=0 compress/uastc_level=0
@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1 compress/hdr_compression=1
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=true
mipmaps/limit=-1 mipmaps/limit=-1
roughness/mode=0 roughness/mode=0
roughness/src_normal="" roughness/src_normal=""
@ -37,4 +38,4 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false process/hdr_as_srgb=false
process/hdr_clamp_exposure=false process/hdr_clamp_exposure=false
process/size_limit=0 process/size_limit=0
detect_3d/compress_to=1 detect_3d/compress_to=0

View File

@ -1,2 +1,3 @@
extends Node extends Node
var chunk_size: float = 150 var chunk_size: float = 150
var station_coords: Vector3 = Vector3.ZERO

View File

@ -50,6 +50,8 @@ func initialize_world() -> void:
var station = Vector2i(randi() % dimension, 0) var station = Vector2i(randi() % dimension, 0)
var spawn = Vector2i(dimension - station.x - 1, dimension - 1) var spawn = Vector2i(dimension - station.x - 1, dimension - 1)
Global.station_coords = Vector3(station.x + Global.chunk_size/2, 0, station.y + Global.chunk_size/2)
$Player.position.x = spawn.x * Global.chunk_size $Player.position.x = spawn.x * Global.chunk_size
$Player.position.z = spawn.y * Global.chunk_size $Player.position.z = spawn.y * Global.chunk_size

View File

@ -17,6 +17,7 @@ fog_sky_affect = 0.39
fog_height = 2.3 fog_height = 2.3
[node name="Level" type="Node3D" unique_id=1248504413] [node name="Level" type="Node3D" unique_id=1248504413]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.44119096, 0)
script = ExtResource("1_0b4ue") script = ExtResource("1_0b4ue")
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=2012504496] [node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=2012504496]

View File

@ -52,6 +52,8 @@ func _process(delta: float) -> void:
# On fail screen, ignore further input # On fail screen, ignore further input
if not is_active: if not is_active:
return return
$Arrow.look_at(Global.station_coords)
$HUD/StaminaRect.scale.x = stamina / max_stamina $HUD/StaminaRect.scale.x = stamina / max_stamina
$HUD/StageLabel.text = "Stage %d" % [stage_counter + 1] $HUD/StageLabel.text = "Stage %d" % [stage_counter + 1]

View File

@ -28,7 +28,12 @@ radius = 30.0
height = 0.5 height = 0.5
radius = 50.0 radius = 50.0
[sub_resource type="QuadMesh" id="QuadMesh_hqtel"] [sub_resource type="PlaneMesh" id="PlaneMesh_sweqy"]
size = Vector2(4, 4)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2hs0m"]
transparency = 1
albedo_texture = ExtResource("4_hqtel")
[node name="Player" type="CharacterBody3D" unique_id=17046866] [node name="Player" type="CharacterBody3D" unique_id=17046866]
collision_layer = 4 collision_layer = 4
@ -297,11 +302,10 @@ debug_color = Color(0.5381443, 0.5430501, 0.4771669, 0.41960785)
shape = SubResource("CylinderShape3D_hqtel") shape = SubResource("CylinderShape3D_hqtel")
debug_color = Color(0.6328197, 0.113640614, 0, 0.41960785) debug_color = Color(0.6328197, 0.113640614, 0, 0.41960785)
[node name="Arrow" type="MeshInstance2D" parent="." unique_id=1435818053] [node name="Arrow" type="MeshInstance3D" parent="." unique_id=870899544]
position = Vector2(604, 57) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0)
scale = Vector2(69.25001, 66.25001) mesh = SubResource("PlaneMesh_sweqy")
mesh = SubResource("QuadMesh_hqtel") surface_material_override/0 = SubResource("StandardMaterial3D_2hs0m")
texture = ExtResource("4_hqtel")
[connection signal="timeout" from="TimeLimit" to="." method="_on_time_limit_timeout"] [connection signal="timeout" from="TimeLimit" to="." method="_on_time_limit_timeout"]
[connection signal="shop_exit" from="Shop" to="." method="_on_shop_shop_exit"] [connection signal="shop_exit" from="Shop" to="." method="_on_shop_shop_exit"]