From 125cb3fdb0a883636566aa9d48e63738f8e4c129 Mon Sep 17 00:00:00 2001 From: Dusk Date: Fri, 6 Mar 2026 09:35:24 +0100 Subject: [PATCH] feat: Rotate arrow to point at station --- assets/Images/arrow.png.import | 13 +++++++------ global.gd | 1 + level.gd | 2 ++ level.tscn | 1 + player.gd | 2 ++ player.tscn | 16 ++++++++++------ 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/assets/Images/arrow.png.import b/assets/Images/arrow.png.import index a409751..fd7c96d 100644 --- a/assets/Images/arrow.png.import +++ b/assets/Images/arrow.png.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://bpfvioqm4kbv8" -path="res://.godot/imported/arrow.png-9053f2b1a9a256ad0bb19fe69a4c452c.ctex" +path.s3tc="res://.godot/imported/arrow.png-9053f2b1a9a256ad0bb19fe69a4c452c.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] 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] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/global.gd b/global.gd index 3f1e2b1..60b8603 100644 --- a/global.gd +++ b/global.gd @@ -1,2 +1,3 @@ extends Node var chunk_size: float = 150 +var station_coords: Vector3 = Vector3.ZERO diff --git a/level.gd b/level.gd index bb3864b..41c1953 100644 --- a/level.gd +++ b/level.gd @@ -50,6 +50,8 @@ func initialize_world() -> void: var station = Vector2i(randi() % dimension, 0) 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.z = spawn.y * Global.chunk_size diff --git a/level.tscn b/level.tscn index 12b6666..fc5d194 100644 --- a/level.tscn +++ b/level.tscn @@ -17,6 +17,7 @@ fog_sky_affect = 0.39 fog_height = 2.3 [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") [node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=2012504496] diff --git a/player.gd b/player.gd index b6203af..91f1c45 100644 --- a/player.gd +++ b/player.gd @@ -52,6 +52,8 @@ func _process(delta: float) -> void: # On fail screen, ignore further input if not is_active: return + + $Arrow.look_at(Global.station_coords) $HUD/StaminaRect.scale.x = stamina / max_stamina $HUD/StageLabel.text = "Stage %d" % [stage_counter + 1] diff --git a/player.tscn b/player.tscn index 492ebac..c8947d9 100644 --- a/player.tscn +++ b/player.tscn @@ -28,7 +28,12 @@ radius = 30.0 height = 0.5 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] collision_layer = 4 @@ -297,11 +302,10 @@ debug_color = Color(0.5381443, 0.5430501, 0.4771669, 0.41960785) shape = SubResource("CylinderShape3D_hqtel") debug_color = Color(0.6328197, 0.113640614, 0, 0.41960785) -[node name="Arrow" type="MeshInstance2D" parent="." unique_id=1435818053] -position = Vector2(604, 57) -scale = Vector2(69.25001, 66.25001) -mesh = SubResource("QuadMesh_hqtel") -texture = ExtResource("4_hqtel") +[node name="Arrow" type="MeshInstance3D" parent="." unique_id=870899544] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0) +mesh = SubResource("PlaneMesh_sweqy") +surface_material_override/0 = SubResource("StandardMaterial3D_2hs0m") [connection signal="timeout" from="TimeLimit" to="." method="_on_time_limit_timeout"] [connection signal="shop_exit" from="Shop" to="." method="_on_shop_shop_exit"]