Compare commits
4 Commits
6431603630
...
f26be55c71
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f26be55c71 | ||
|
|
dcfa6fa925 | ||
|
|
ebfa23f500 | ||
|
|
e69ffeef7c |
@@ -2,7 +2,7 @@ extends Control
|
||||
|
||||
var grid: AStarGrid2D:
|
||||
set(v): grid = v; queue_redraw()
|
||||
var show_grid_display: bool:
|
||||
@export var show_grid_display: bool:
|
||||
set(v): show_grid_display = v; queue_redraw()
|
||||
|
||||
func toggle_grid_display(on: bool):
|
||||
|
||||
@@ -38,6 +38,7 @@ position = Vector2(10, -10)
|
||||
wait_time = 0.1
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(50, 50)
|
||||
scale = Vector2(2, 2)
|
||||
texture = SubResource("PlaceholderTexture2D_y3v7k")
|
||||
@@ -51,6 +52,7 @@ anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
script = ExtResource("8_y3v7k")
|
||||
show_grid_display = true
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="HUD/GridDisplay"]
|
||||
layout_mode = 0
|
||||
@@ -65,7 +67,7 @@ layout_mode = 2
|
||||
text = "Show Grid"
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("9_hryqi")]
|
||||
position = Vector2(8, 8)
|
||||
position = Vector2(150, 150)
|
||||
|
||||
[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"]
|
||||
|
||||
@@ -2,7 +2,8 @@ extends CharacterBody2D
|
||||
|
||||
@export var unitData = {
|
||||
"MoveRange": 5,
|
||||
"MoveRangeV": Vector2i(5, 5),
|
||||
"MoveRangeVi": Vector2i(5, 5),
|
||||
"MoveRangeV": Vector2(5, 5),
|
||||
"Speed": 400.0
|
||||
}
|
||||
|
||||
@@ -63,7 +64,7 @@ func _physics_process(delta: float) -> void:
|
||||
currentCell = pos_to_cell(global_position)
|
||||
$PathPrev.points = [];
|
||||
moving = false; MoveFinished.emit();
|
||||
MapGlobal.SetRegion(calculateMovementRegion(), unitData["MoveRangeV"])
|
||||
MapGlobal.SetRegion(calculateMovementRegion(), -unitData["MoveRangeVi"])
|
||||
|
||||
else:
|
||||
var direction = (movePts[currentPoint+1] - movePts[currentPoint]).normalized()
|
||||
@@ -80,6 +81,5 @@ func selectUnit(cell: Vector2i):
|
||||
selected = false
|
||||
|
||||
func calculateMovementRegion():
|
||||
var region := Rect2i(pos_to_cell(global_position), Vector2i(unitData["MoveRange"], unitData["MoveRange"]))
|
||||
region.set_center
|
||||
var region := Rect2i(pos_to_cell(global_position - unitData["MoveRangeV"]), unitData["MoveRangeVi"] * 2)
|
||||
return region
|
||||
|
||||
21
addons/godot-git-plugin/LICENSE
Normal file
21
addons/godot-git-plugin/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2023 The Godot Engine community
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1346
addons/godot-git-plugin/THIRDPARTY.md
Normal file
1346
addons/godot-git-plugin/THIRDPARTY.md
Normal file
File diff suppressed because it is too large
Load Diff
10
addons/godot-git-plugin/git_plugin.gdextension
Normal file
10
addons/godot-git-plugin/git_plugin.gdextension
Normal file
@@ -0,0 +1,10 @@
|
||||
[configuration]
|
||||
|
||||
entry_symbol = "git_plugin_init"
|
||||
compatibility_minimum = "4.2.0"
|
||||
|
||||
[libraries]
|
||||
|
||||
linux.editor.x86_64 = "linux/libgit_plugin.linux.editor.x86_64.so"
|
||||
macos.editor = "macos/libgit_plugin.macos.editor.universal.dylib"
|
||||
windows.editor.x86_64 = "windows/libgit_plugin.windows.editor.x86_64.dll"
|
||||
1
addons/godot-git-plugin/git_plugin.gdextension.uid
Normal file
1
addons/godot-git-plugin/git_plugin.gdextension.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://coeqykxqx1fl6
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -31,6 +31,11 @@ window/size/no_focus=true
|
||||
|
||||
project/assembly_name="TurnBasedStrategyGame"
|
||||
|
||||
[editor]
|
||||
|
||||
version_control/plugin_name="GitPlugin"
|
||||
version_control/autoload_on_startup=true
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray("res://addons/smartcamera2D/plugin.cfg")
|
||||
|
||||
Reference in New Issue
Block a user