diff --git a/Scenes/Main/main.gd b/Scenes/Main/main.gd index 07fd5f8..1e3dcc5 100644 --- a/Scenes/Main/main.gd +++ b/Scenes/Main/main.gd @@ -39,6 +39,8 @@ func _ready() -> void: # if firstUnit.is_node_ready(): # UnitCamera.target = _Units[0].get_path_to(get_parent()) # UnitCamera.target_node = _Units[0] + + $Player.setup($Map.getGrid()) # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: diff --git a/Scenes/Main/main.tscn b/Scenes/Main/main.tscn index 6419de7..770c765 100644 --- a/Scenes/Main/main.tscn +++ b/Scenes/Main/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://d05j5yuhlsxp0"] +[gd_scene load_steps=13 format=3 uid="uid://d05j5yuhlsxp0"] [ext_resource type="PackedScene" uid="uid://cywuuce71rmgb" path="res://Scenes/Map/map.tscn" id="1_1r6ip"] [ext_resource type="Script" uid="uid://btdvxp8ckmeb3" path="res://Scenes/Main/main.gd" id="1_qw60k"] @@ -8,9 +8,16 @@ [ext_resource type="PackedScene" uid="uid://b1d6lktijxy3s" path="res://Scenes/Unit/move/unit.tscn" id="6_2a143"] [ext_resource type="Script" uid="uid://cidjtc27oj1gn" path="res://Scenes/Main/cursor.gd" id="7_y3v7k"] [ext_resource type="Script" uid="uid://dtme43jtijpok" path="res://Scenes/Main/grid_display.gd" id="8_y3v7k"] +[ext_resource type="Script" uid="uid://dm40sxvvnbdrn" path="res://Scenes/Main/player.gd" id="9_hryqi"] [sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_y3v7k"] +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_imbg2"] +size = Vector2(16, 16) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_hfg1r"] +size = Vector2(32, 32) + [node name="Main" type="Node"] script = ExtResource("1_qw60k") grid = ExtResource("5_p6jpk") @@ -70,6 +77,20 @@ layout_mode = 2 layout_mode = 2 text = "Show Grid" +[node name="Player" type="CharacterBody2D" parent="."] +script = ExtResource("9_hryqi") + +[node name="PathPrev" type="Line2D" parent="Player"] +top_level = true +width = 2.0 +default_color = Color(0, 0.3372549, 0.3372549, 1) + +[node name="Sprite2D" type="Sprite2D" parent="Player"] +texture = SubResource("PlaceholderTexture2D_imbg2") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"] +shape = SubResource("RectangleShape2D_hfg1r") + [connection signal="accept_pressed" from="GameBoard/Cursor" to="." method="get_cell_information"] [connection signal="toggled" from="HUD/GridDisplay/MarginContainer/PanelContainer/ShowGrid" to="HUD/GridDisplay" method="toggle_grid_display"]