From ab89478f2d7a8ab1eefbae0e29355fc951d325d5 Mon Sep 17 00:00:00 2001 From: hz Date: Fri, 7 Nov 2025 16:35:25 -0600 Subject: [PATCH] Added a character that will move to the cell that is left clicked on --- scenes/Grid/grid_field.tscn | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/scenes/Grid/grid_field.tscn b/scenes/Grid/grid_field.tscn index 436fded..f1cf7e4 100644 --- a/scenes/Grid/grid_field.tscn +++ b/scenes/Grid/grid_field.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=12 format=4 uid="uid://qd6xvgwrd00g"] +[gd_scene load_steps=14 format=4 uid="uid://qd6xvgwrd00g"] -[ext_resource type="Script" uid="uid://3goclr4srt7k" path="res://scenes/Grid/grid_plane_manager.gd" id="1_72cxc"] -[ext_resource type="Script" uid="uid://5p4mcxw7wann" path="res://scenes/Grid/grid_camera_controller.gd" id="2_o2iv9"] -[ext_resource type="Script" uid="uid://ehef5rrel4d6" path="res://scenes/Grid/grid_highlight_controller.gd" id="3_n2b7o"] -[ext_resource type="Script" uid="uid://oy8cl8dscrh2" path="res://scenes/Grid/day_night_controller.gd" id="4_u8bvi"] +[ext_resource type="Script" path="res://scenes/Grid/grid_plane_manager.gd" id="1_72cxc"] +[ext_resource type="Script" path="res://scenes/Grid/grid_camera_controller.gd" id="2_o2iv9"] +[ext_resource type="Script" path="res://scenes/Grid/grid_highlight_controller.gd" id="3_n2b7o"] +[ext_resource type="Script" path="res://scenes/Grid/day_night_controller.gd" id="4_u8bvi"] +[ext_resource type="Script" path="res://scenes/Grid/grid_character_controller.gd" id="5_n4d0h"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ground"] albedo_color = Color(0.211765, 0.364706, 0.211765, 1) @@ -40,6 +41,12 @@ albedo_color = Color(0.976471, 0.843137, 0.333333, 0.6) [sub_resource type="PlaneMesh" id="PlaneMesh_dce6m"] size = Vector2(1, 1) +[sub_resource type="SphereMesh" id="SphereMesh_character"] +radius = 0.35 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_character"] +albedo_color = Color(0.941176, 0.403922, 0.262745, 1) + [node name="GridField" type="Node3D"] script = ExtResource("1_72cxc") columns = 10 @@ -95,3 +102,15 @@ mesh = SubResource("PlaneMesh_dce6m") script = ExtResource("3_n2b7o") grid_manager_path = NodePath("..") camera_path = NodePath("../Camera3D") + +[node name="GridCharacter" type="Node3D" parent="."] +unique_name_in_owner = true +script = ExtResource("5_n4d0h") +grid_manager_path = NodePath("..") +camera_path = NodePath("../Camera3D") +start_cell = Vector2i(0, 0) +move_speed = 5.0 + +[node name="Mesh" type="MeshInstance3D" parent="GridCharacter"] +mesh = SubResource("SphereMesh_character") +material_override = SubResource("StandardMaterial3D_character")