finished reowrking grid maps, polished astar pathfinding, started work on aiming functions --todo: change launch speed to constant, change aim function to take into account the angle it would need to launch at to hit mouse position like in peggle, add raycasting

This commit is contained in:
2026-06-03 02:44:13 -04:00
parent 7b5cd9d5f6
commit c97b0e5cc2
24 changed files with 1108 additions and 1104 deletions
+18 -1
View File
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using Godot;
public partial class Attack : RigidBody2D
@@ -8,17 +9,33 @@ public partial class Attack : RigidBody2D
public bool _hovered = false;
public int _damage = 1;
public Vector2 _speed;
public Path2D _predictionPath;
public Commander _commanderOwner;
public override void _Ready()
{
base._Ready();
_predictionPath = GetNode<Path2D>("PredictedPath");
}
public override void _PhysicsProcess(double delta)
{
base._PhysicsProcess(delta);
if (_speed != Vector2.Zero){
ApplyCentralForce(_speed);
ApplyCentralImpulse(_speed);
_speed = Vector2.Zero;
}
}
public void DrawPath(List<Vector2> POINTS)
{
_predictionPath.Curve.ClearPoints();
for (int i = 0; i < POINTS.Count; i++)
{
_predictionPath.Curve.AddPoint(POINTS[i]);
}
}
public void Shoot(Vector2 FORCE){
_speed = FORCE;
GravityScale = 1;
+2 -1
View File
@@ -26,11 +26,12 @@ public partial class Commander : Sprite2D
}
}
public void LoadAttack()
public void LoadAttack(Vector2 OFFSET)
{
if (_attack == null)
{
_attack = _attackScene.Instantiate<Attack>();
_attack.Position = OFFSET;
_attack._commanderOwner = this;
_attack.GravityScale = 0;
AddChild(_attack);
+1 -60
View File
@@ -8,9 +8,8 @@ public partial class Enemy : StaticBody2D
[Signal]
public delegate void DeathEventHandler(Enemy THIS);
public int _damage = 1, _health = 2, _speed, _visibilityRange = 10;
public Vector2I _range = Vector2I.Up;
public Vector2I _address, _range = Vector2I.Up;
public float _movement = 0;
public GridMarker _gridMarker;
public EnemyController _enemyController;
public override void _Ready()
@@ -32,64 +31,6 @@ public partial class Enemy : StaticBody2D
}
public List<GridMarker> Pathfinding(GridMarker DESTINATION, bool INCLUDE_SELF = false)
{
PriorityQueue<GridMarker, float> queue = new();
queue.Enqueue(_gridMarker, 0f);
Dictionary<GridMarker, GridMarker> cameFrom = new();
Dictionary<GridMarker, float> costSoFar = new();
cameFrom[_gridMarker] = null;
costSoFar[_gridMarker] = 0f;
GridMarker current;
float newCost, priority;
while (queue.Count > 0)
{
current = queue.Dequeue();
if (current == DESTINATION)
{
break;
}
List<GridMarker> neighbors = current.GetMarkersInRange(1.5f);
for (int j = 0; j < neighbors.Count; j++)
{
GridMarker next = neighbors[j];
if (next._occupant != null)
{
continue;
}
newCost = costSoFar[current] + 1;
if (!costSoFar.TryGetValue(next, out float value) || newCost < value)
{
costSoFar[next] = newCost;
priority = newCost;
queue.Enqueue(next, priority);
cameFrom[next] = current;
}
}
}
List<GridMarker> path = new();
GridMarker pathMarker = DESTINATION;
if (cameFrom.ContainsKey(pathMarker))
{
while (pathMarker != null)
{
path.Add(pathMarker);
pathMarker = cameFrom[pathMarker];
}
path.Reverse();
if (!INCLUDE_SELF)
{
path.Remove(_gridMarker);
}
}
return path;
}
public void TakeDamage(int DAMAGE, Commander ATTACKER)
{
_health -= DAMAGE;
+47 -42
View File
@@ -16,13 +16,13 @@ public partial class EnemyController : TurnController
{
Enemy newEnemy = _enemyScene.Instantiate<Enemy>();
newEnemy.Death += RemoveEnemy;
List<GridMarker> lastRow = _grid._gridMarkers.Last();
List<GridMarker> unoccupiedMarkers = [.. lastRow.Where(m => m._occupant == null).Cast<GridMarker>()];
GridMarker randomMarker = unoccupiedMarkers[Globals._rng.Next(unoccupiedMarkers.Count)];
newEnemy._speed = Globals._rng.Next(2,4+1);
newEnemy.Modulate = new Color(newEnemy._speed == 2 ? "#FF0000" : newEnemy._speed == 3 ? "#00FF00" : "#0000FF");
newEnemy._enemyController = this;
WarpEnemy(newEnemy, randomMarker);
List<Vector2I> unoccupied = [.. _playArea._map._bottomRow.Where(c => _enemies.All(e => e._address != c))];
Vector2I randomCell = unoccupied[Globals._rng.Next(unoccupied.Count)];
WarpEnemy(newEnemy, randomCell);
_enemies.Add(newEnemy);
AddChild(newEnemy);
}
@@ -33,42 +33,45 @@ public partial class EnemyController : TurnController
AddEnemies(3);
}
// public void MoveEnemy(Enemy ENEMY)
// {
// ENEMY._gridMarker = _grid.GetMarkerFromOffset(ENEMY._gridMarker, ENEMY._speed);
// Tween tween = CreateTween();
// tween.TweenProperty(ENEMY, "global_position", ENEMY._gridMarker.GlobalPosition, 1.0f);
// }
public void MoveEnemies(List<Enemy> ENEMIES = null)
public void MoveEnemies()
{
ENEMIES ??= _enemies;
ENEMIES = [.. ENEMIES.OrderByDescending(e => e._gridMarker._address.Y).ThenByDescending(e => e._gridMarker._address.X)];
// Tween tween = CreateTween();
// tween.SetParallel();
Dictionary<Enemy, List<GridMarker>> enemyPaths = new();
ENEMIES[0].Pathfinding(_grid.GetMarkerByAddress(new Vector2I(ENEMIES[0]._gridMarker._address.X, ENEMIES[0]._gridMarker._address.Y - ENEMIES[0]._visibilityRange)));
// for (int i = 0; i < ENEMIES.Count; i++)
// {
// enemyPaths[ENEMIES[i]] = ENEMIES[i].Pathfinding(_grid.GetMarkerByAddress(new Vector2I(ENEMIES[i]._gridMarker._address.X, 0)));
// }
Tween tween = CreateTween();
tween.SetParallel();
Dictionary<Enemy, List<Vector2I>> enemyPaths = new();
for (int i = 0; i < _enemies.Count; i++)
{
Enemy enemy = _enemies[i];
List<Vector2I> path = _playArea._map.GetPath(enemy._address, new Vector2I(enemy._address.X, _playArea._map._minY));
enemyPaths[enemy] = path;
}
int maxSteps = enemyPaths.Select(p => p.Value.Count).Max();
// GD.Print(maxSteps);
// for (int i = 0; i < maxSteps; i++)
// {
// Dictionary<Enemy, List<GridMarker>> qualifyingPaths = (Dictionary<Enemy, List<GridMarker>>)enemyPaths.Where(p => p.Value.Count <= maxSteps);
// for (int j = 0; j < qualifyingPaths.Count; j++)
// {
// Enemy enemy = qualifyingPaths.ElementAt(j).Key;
// GridMarker marker = qualifyingPaths.ElementAt(j).Value.ElementAt(i);
// if (j == 0)
// {
// tween.Chain();
// }
// tween.TweenProperty(enemy, "global_position", enemy._gridMarker.GlobalPosition, 0.4f);
// }
// }
int maxSpeed = _enemies.Max(e => e._speed);
for (int i = 0; i < maxSpeed; i++)
{
for (int j = 0; j < enemyPaths.Count; j++)
{
Enemy enemy = enemyPaths.ElementAt(j).Key;
if (i >= enemy._speed)
{
continue;
}
List<Vector2I> path = enemyPaths.ElementAt(j).Value;
Vector2I cell = path[i];
enemy._address = cell;
if (j == 0)
{
tween.Chain();
}
else
{
tween.Parallel();
}
tween.TweenProperty(enemy, "global_position", _playArea._map.GetCellPositionFromAddress(enemy._address), .2f);
}
}
tween.TweenCallback(Callable.From(() => EmitSignal(SignalName.TurnDone)));
}
public void RemoveEnemy(Enemy ENEMY_TO_REMOVE)
@@ -79,13 +82,15 @@ public partial class EnemyController : TurnController
public override void StartTurn()
{
AddEnemies();
AddEnemies(1);
MoveEnemies();
}
public void WarpEnemy(Enemy ENEMY, GridMarker DESTINATION_MARKER)
public void WarpEnemy(Enemy ENEMY, Vector2I CELL)
{
ENEMY._gridMarker = DESTINATION_MARKER;
ENEMY.GlobalPosition = DESTINATION_MARKER.GlobalPosition;
ENEMY._address = CELL;
ENEMY.GlobalPosition = _playArea._map.GetCellPositionFromAddress(CELL);
}
}
+1
View File
@@ -4,4 +4,5 @@ using System;
public partial class Globals : Node
{
public static Random _rng = new();
}
-79
View File
@@ -1,79 +0,0 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class GridMap2D : Node2D
{
public int _cellSize = 16;
public Vector2 _sizeInPixels, _sizeInCells;
public Area2D _playArea;
public GridMarker _gridMarker;
public List<StaticBody2D> _leftEdges = new(), _rightEdges = new();
public List<List<GridMarker>> _gridMarkers = new();
public override void _Ready()
{
base._Ready();
_playArea = GetNode<Area2D>("PlayArea");
StaticBody2D firstOnLeft = GetNode<StaticBody2D>("LeftEdge1");
StaticBody2D firstOnRight = GetNode<StaticBody2D>("RightEdge1");
_leftEdges.Add(firstOnLeft);
_rightEdges.Add(firstOnRight);
CollisionShape2D firstOnLeftBounds = firstOnLeft.GetNode<CollisionShape2D>("Bounds");
CollisionShape2D firstOnRightBounds = firstOnRight.GetNode<CollisionShape2D>("Bounds");
_gridMarker = GetNode<GridMarker>("GridMarker");
CollisionShape2D playAreaBounds = _playArea.GetNode<CollisionShape2D>("Bounds");
_sizeInPixels = new Vector2((int)playAreaBounds.Shape.GetRect().Size.X, (int)playAreaBounds.Shape.GetRect().Size.Y);
_sizeInCells = new Vector2(_sizeInPixels.X / _cellSize, _sizeInPixels.Y / _cellSize);
for (int i = 0; i < _sizeInCells.Y; i++)
{
_gridMarkers.Add([]);
for (int j = 0; j < _sizeInCells.X; j++)
{
GridMarker newGridMarker = (GridMarker)_gridMarker.Duplicate();
newGridMarker._address = new Vector2I(j, i);
newGridMarker.Position = new Vector2(_playArea.Position.X - playAreaBounds.Shape.GetRect().Size.X / 2 + (j+.5f)*_cellSize, _playArea.Position.Y - playAreaBounds.Shape.GetRect().Size.Y / 2 + (i+.5f)*_cellSize);
_gridMarkers[i].Add(newGridMarker);
AddChild(newGridMarker);
}
}
int leftEdgeSectionSizeY = (int)firstOnLeftBounds.Shape.GetRect().Size.Y, rightEdgeSectionSizeY = (int)firstOnRightBounds.Shape.GetRect().Size.Y;
int leftEdgeSectionsCount = (int)_sizeInPixels.Y / leftEdgeSectionSizeY, rightEdgeSectionsCount = (int)_sizeInPixels.Y / rightEdgeSectionSizeY;
for (int i = 1; i < leftEdgeSectionsCount; i++)
{
StaticBody2D newLeftSection = (StaticBody2D)firstOnLeft.Duplicate();
newLeftSection.Position += new Vector2(0, leftEdgeSectionSizeY * i);
_leftEdges.Add(newLeftSection);
AddChild(newLeftSection);
}
for (int i = 1; i < rightEdgeSectionsCount; i++)
{
StaticBody2D newRightSection = (StaticBody2D)firstOnRight.Duplicate();
newRightSection.Position += new Vector2(0, rightEdgeSectionSizeY * i);
_rightEdges.Add(newRightSection);
AddChild(newRightSection);
}
_gridMarker.QueueFree();
}
public GridMarker GetMarkerByAddress(Vector2I COORDINATES)
{
return _gridMarkers[COORDINATES.Y][COORDINATES.X];
}
public GridMarker GetMarkerFromOffset(GridMarker GRID_MARKER, Vector2I STEP)
{
return _gridMarkers[GRID_MARKER._address.Y + STEP.Y][GRID_MARKER._address.X + STEP.X];
}
public List<GridMarker> GetMarkerInRange(GridMarker GRID_MARKER, int RANGE)
{
return [.. _gridMarkers.SelectMany(m => m).Where(m => (GRID_MARKER._address - m._address).Length() <= RANGE).Cast<GridMarker>()];
}
}
-32
View File
@@ -1,32 +0,0 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class GridMarker : Marker2D
{
public Vector2I _address;
public Node _occupant;
public List<GridMarker> _gridMarkers;
public override void _Ready()
{
base._Ready();
}
public List<GridMarker> GetMarkersInRange(float RANGE = 1.0f, bool INCLUDE_SELF = false){
if (_gridMarkers == null || _gridMarkers.Count == 0)
{
_gridMarkers = [.. GetTree().GetNodesInGroup("GridMarkers").Cast<GridMarker>()];
}
List<GridMarker> returnList = [.. _gridMarkers.Where(m => (_address - m._address).Length() <= RANGE).Cast<GridMarker>()];
if (!INCLUDE_SELF)
{
returnList.Remove(this);
}
return returnList;
}
}
-1
View File
@@ -1 +0,0 @@
uid://cob0pwghnubxa
+4 -4
View File
@@ -5,7 +5,7 @@ using System.Linq;
public partial class Main : Node
{
public GridMap2D _grid;
public PlayArea _playArea;
public PlayerController _playerController;
public EnemyController _enemyController;
public TurnController _turnController;
@@ -13,15 +13,15 @@ public partial class Main : Node
public override void _Ready()
{
base._Ready();
_grid = GetNode<GridMap2D>("GridMap2D");
_playArea = GetNode<PlayArea>("PlayArea");
_playerController = GetNode<PlayerController>("PlayerController");
_enemyController = GetNode<EnemyController>("EnemyController");
_playerController._enemyController = _enemyController;
_enemyController._playerController = _playerController;
_playerController._grid = _grid;
_enemyController._grid = _grid;
_playerController._playArea = _playArea;
_enemyController._playArea = _playArea;
_playerController.TurnDone += ChangeTurn;
_enemyController.TurnDone += ChangeTurn;
+77
View File
@@ -0,0 +1,77 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class Map : TileMapLayer
{
public int _minX, _maxX, _minY, _maxY, _mainSource = 0;
public string _isSolidString = "is_solid";
public Vector2 _cellSize, _sizeInPixels, _sizeInCells;
public Vector2I _pathTakenAtlasCoordinates = new Vector2I(4, 0);
public List<Vector2I> _leftmostColumn, _rightmostColumn, _topRow, _bottomRow;
public AStarGrid2D _astar = new();
public override void _Ready()
{
base._Ready();
_cellSize = TileSet.TileSize;
List<Vector2I> cells = GetUsedCells().ToList();
_minX = cells.Min(c => c.X);
_maxX = cells.Max(c => c.X);
_minY = cells.Min(c => c.Y);
_maxY = cells.Max(c => c.Y);
_leftmostColumn = [.. cells.Where(c => c.X == _minX)];
_rightmostColumn = [.. cells.Where(c => c.X == _maxX)];
_topRow = [.. cells.Where(c => c.Y == _minY)];
_bottomRow = [.. cells.Where(c => c.Y == _maxY)];
_sizeInCells = new Vector2(_topRow.Count, _leftmostColumn.Count);
_sizeInPixels = _sizeInCells * _cellSize;
SetupAstar();
}
public Vector2 GetCellPositionFromAddress(Vector2I CELL_ADDRESS)
{
return GlobalPosition + CELL_ADDRESS * _cellSize + _cellSize / 2;
}
public bool IsCellSolid(Vector2I CELL_TO_CHECK)
{
return (bool)GetCellTileData(CELL_TO_CHECK).GetCustomData(_isSolidString);
}
public void SetupAstar()
{
_astar.Region = new Rect2I(_minX, _minY, _topRow.Count, _leftmostColumn.Count);
_astar.CellSize = _cellSize;
_astar.DefaultComputeHeuristic = AStarGrid2D.Heuristic.Manhattan;
_astar.DiagonalMode = AStarGrid2D.DiagonalModeEnum.Never;
_astar.Update();
List<Vector2I> cells = [.. GetUsedCells()];
for (int i = 0; i < cells.Count; i++)
{
_astar.SetPointSolid(cells[i], IsCellSolid(cells[i]));
}
}
public List<Vector2I> GetPath(Vector2I FROM, Vector2I TO, bool INCLUDE_FROM = false, bool SHOW_PATH = false)
{
List<Vector2I> pathTaken = [.. _astar.GetIdPath(FROM, TO)];
if (SHOW_PATH)
{
for (int i = 0; i < pathTaken.Count; i++)
{
Vector2I cell = pathTaken[i];
SetCell(cell, _mainSource, _pathTakenAtlasCoordinates);
}
}
if (!INCLUDE_FROM)
{
pathTaken.Remove(FROM);
}
return pathTaken;
}
}
+1
View File
@@ -0,0 +1 @@
uid://d2ri1sa0jwtqm
+33
View File
File diff suppressed because one or more lines are too long
+25
View File
@@ -0,0 +1,25 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class PlayArea : Node2D
{
public Node2D _leftEdge, _rightEdge;
public Area2D _region;
public Map _map;
public override void _Ready()
{
base._Ready();
_region = GetNode<Area2D>("Region");
_leftEdge = GetNode<Node2D>("LeftEdge");
_rightEdge = GetNode<Node2D>("RightEdge");
CollisionShape2D regionBounds = _region.GetNode<CollisionShape2D>("Bounds");
_map = GetNode<Map>("Map");
}
}
+829
View File
@@ -0,0 +1,829 @@
[gd_scene format=3 uid="uid://la8pwcc0tjuu"]
[ext_resource type="Script" uid="uid://bnaxgcafcvtfv" path="res://PlayArea.cs" id="1_lq4m8"]
[ext_resource type="PackedScene" uid="uid://mjinvqj25wha" path="res://Map.tscn" id="2_wqv88"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_q4dkg"]
size = Vector2(1600, 800)
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_7h2rc"]
bounce = 0.4
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7h2rc"]
size = Vector2(400, 18)
[node name="PlayArea" type="Node2D" unique_id=1123610167]
script = ExtResource("1_lq4m8")
metadata/_edit_vertical_guides_ = [-800.0, 800.0]
metadata/_edit_horizontal_guides_ = [400.0, -400.0]
[node name="Region" type="Area2D" parent="." unique_id=1719758298]
[node name="Bounds" type="CollisionShape2D" parent="Region" unique_id=1902214362]
shape = SubResource("RectangleShape2D_q4dkg")
[node name="LeftEdge" type="Node2D" parent="." unique_id=2068905137]
[node name="Section1" type="StaticBody2D" parent="LeftEdge" unique_id=1883047200]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section1" unique_id=1546734575]
position = Vector2(-1000, -392)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section2" type="StaticBody2D" parent="LeftEdge" unique_id=178478203]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section2" unique_id=1682498045]
position = Vector2(-1000, -376)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section3" type="StaticBody2D" parent="LeftEdge" unique_id=1624435616]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section3" unique_id=902262355]
position = Vector2(-1000, -360)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section4" type="StaticBody2D" parent="LeftEdge" unique_id=1332613815]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section4" unique_id=1316706017]
position = Vector2(-1000, -344)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section5" type="StaticBody2D" parent="LeftEdge" unique_id=752246581]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section5" unique_id=1628834606]
position = Vector2(-1000, -328)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section6" type="StaticBody2D" parent="LeftEdge" unique_id=1495742293]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section6" unique_id=53765240]
position = Vector2(-1000, -312)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section7" type="StaticBody2D" parent="LeftEdge" unique_id=1067759067]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section7" unique_id=1258555334]
position = Vector2(-1000, -296)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section8" type="StaticBody2D" parent="LeftEdge" unique_id=1472582372]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section8" unique_id=1274223146]
position = Vector2(-1000, -280)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section9" type="StaticBody2D" parent="LeftEdge" unique_id=1492255380]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section9" unique_id=1259981684]
position = Vector2(-1000, -264)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section10" type="StaticBody2D" parent="LeftEdge" unique_id=811939382]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section10" unique_id=1759439321]
position = Vector2(-1000, -248)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section11" type="StaticBody2D" parent="LeftEdge" unique_id=1831293827]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section11" unique_id=222922]
position = Vector2(-1000, -232)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section12" type="StaticBody2D" parent="LeftEdge" unique_id=1518384869]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section12" unique_id=2110889621]
position = Vector2(-1000, -216)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section13" type="StaticBody2D" parent="LeftEdge" unique_id=966565045]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section13" unique_id=2112458974]
position = Vector2(-1000, -200)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section14" type="StaticBody2D" parent="LeftEdge" unique_id=1588187319]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section14" unique_id=1529796563]
position = Vector2(-1000, -184)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section15" type="StaticBody2D" parent="LeftEdge" unique_id=335557082]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section15" unique_id=1410460024]
position = Vector2(-1000, -168)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section16" type="StaticBody2D" parent="LeftEdge" unique_id=1323686421]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section16" unique_id=2053438582]
position = Vector2(-1000, -152)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section17" type="StaticBody2D" parent="LeftEdge" unique_id=990655211]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section17" unique_id=457844067]
position = Vector2(-1000, -136)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section18" type="StaticBody2D" parent="LeftEdge" unique_id=935979711]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section18" unique_id=424918850]
position = Vector2(-1000, -120)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section19" type="StaticBody2D" parent="LeftEdge" unique_id=1746108733]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section19" unique_id=36682950]
position = Vector2(-1000, -104)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section20" type="StaticBody2D" parent="LeftEdge" unique_id=1547752156]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section20" unique_id=712695236]
position = Vector2(-1000, -88)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section21" type="StaticBody2D" parent="LeftEdge" unique_id=2093562800]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section21" unique_id=873761173]
position = Vector2(-1000, -72)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section22" type="StaticBody2D" parent="LeftEdge" unique_id=1142507529]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section22" unique_id=426052783]
position = Vector2(-1000, -56)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section23" type="StaticBody2D" parent="LeftEdge" unique_id=1075734984]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section23" unique_id=1114945969]
position = Vector2(-1000, -40)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section24" type="StaticBody2D" parent="LeftEdge" unique_id=239630138]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section24" unique_id=1782463412]
position = Vector2(-1000, -24)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section25" type="StaticBody2D" parent="LeftEdge" unique_id=1407340940]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section25" unique_id=1162374677]
position = Vector2(-1000, -8)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section26" type="StaticBody2D" parent="LeftEdge" unique_id=1996574660]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section26" unique_id=1235922181]
position = Vector2(-1000, 8)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section27" type="StaticBody2D" parent="LeftEdge" unique_id=1124253426]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section27" unique_id=961536461]
position = Vector2(-1000, 24)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section28" type="StaticBody2D" parent="LeftEdge" unique_id=117950969]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section28" unique_id=342799648]
position = Vector2(-1000, 40)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section29" type="StaticBody2D" parent="LeftEdge" unique_id=114328666]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section29" unique_id=924521689]
position = Vector2(-1000, 56)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section30" type="StaticBody2D" parent="LeftEdge" unique_id=232189810]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section30" unique_id=158150258]
position = Vector2(-1000, 72)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section31" type="StaticBody2D" parent="LeftEdge" unique_id=707564411]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section31" unique_id=91985115]
position = Vector2(-1000, 88)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section32" type="StaticBody2D" parent="LeftEdge" unique_id=1587850767]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section32" unique_id=712543162]
position = Vector2(-1000, 104)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section33" type="StaticBody2D" parent="LeftEdge" unique_id=2119478861]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section33" unique_id=1177372463]
position = Vector2(-1000, 120)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section34" type="StaticBody2D" parent="LeftEdge" unique_id=1243946870]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section34" unique_id=1233985246]
position = Vector2(-1000, 136)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section35" type="StaticBody2D" parent="LeftEdge" unique_id=2007700387]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section35" unique_id=918000097]
position = Vector2(-1000, 152)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section36" type="StaticBody2D" parent="LeftEdge" unique_id=1675481446]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section36" unique_id=1905044566]
position = Vector2(-1000, 168)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section37" type="StaticBody2D" parent="LeftEdge" unique_id=2135053043]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section37" unique_id=1943562251]
position = Vector2(-1000, 184)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section38" type="StaticBody2D" parent="LeftEdge" unique_id=2126459346]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section38" unique_id=391245756]
position = Vector2(-1000, 200)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section39" type="StaticBody2D" parent="LeftEdge" unique_id=1498977766]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section39" unique_id=288895680]
position = Vector2(-1000, 216)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section40" type="StaticBody2D" parent="LeftEdge" unique_id=1631577470]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section40" unique_id=1780145193]
position = Vector2(-1000, 232)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section41" type="StaticBody2D" parent="LeftEdge" unique_id=2043336706]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section41" unique_id=23987948]
position = Vector2(-1000, 248)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section42" type="StaticBody2D" parent="LeftEdge" unique_id=1385399588]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section42" unique_id=18393667]
position = Vector2(-1000, 264)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section43" type="StaticBody2D" parent="LeftEdge" unique_id=2013451272]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section43" unique_id=1206466164]
position = Vector2(-1000, 280)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section44" type="StaticBody2D" parent="LeftEdge" unique_id=1680050273]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section44" unique_id=737477490]
position = Vector2(-1000, 296)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section45" type="StaticBody2D" parent="LeftEdge" unique_id=306551107]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section45" unique_id=646091076]
position = Vector2(-1000, 312)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section46" type="StaticBody2D" parent="LeftEdge" unique_id=2034719308]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section46" unique_id=2061893484]
position = Vector2(-1000, 328)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section47" type="StaticBody2D" parent="LeftEdge" unique_id=498524638]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section47" unique_id=1046604709]
position = Vector2(-1000, 344)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section48" type="StaticBody2D" parent="LeftEdge" unique_id=1889429935]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section48" unique_id=840702218]
position = Vector2(-1000, 360)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section49" type="StaticBody2D" parent="LeftEdge" unique_id=434268205]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section49" unique_id=81829382]
position = Vector2(-1000, 376)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section50" type="StaticBody2D" parent="LeftEdge" unique_id=152783717]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="LeftEdge/Section50" unique_id=172331545]
position = Vector2(-1000, 392)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="RightEdge" type="Node2D" parent="." unique_id=142920402]
[node name="Section1" type="StaticBody2D" parent="RightEdge" unique_id=28199666]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section1" unique_id=1162946372]
position = Vector2(1000, -392)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section2" type="StaticBody2D" parent="RightEdge" unique_id=2013549551]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section2" unique_id=736715833]
position = Vector2(1000, -376)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section3" type="StaticBody2D" parent="RightEdge" unique_id=1869203453]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section3" unique_id=1610058988]
position = Vector2(1000, -360)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section4" type="StaticBody2D" parent="RightEdge" unique_id=1944734298]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section4" unique_id=1089856407]
position = Vector2(1000, -344)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section5" type="StaticBody2D" parent="RightEdge" unique_id=636972928]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section5" unique_id=682865084]
position = Vector2(1000, -328)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section6" type="StaticBody2D" parent="RightEdge" unique_id=1271973845]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section6" unique_id=1374861600]
position = Vector2(1000, -312)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section7" type="StaticBody2D" parent="RightEdge" unique_id=1751568227]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section7" unique_id=302250092]
position = Vector2(1000, -296)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section8" type="StaticBody2D" parent="RightEdge" unique_id=1097293649]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section8" unique_id=1699982357]
position = Vector2(1000, -280)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section9" type="StaticBody2D" parent="RightEdge" unique_id=1080623414]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section9" unique_id=282786821]
position = Vector2(1000, -264)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section10" type="StaticBody2D" parent="RightEdge" unique_id=1361775702]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section10" unique_id=1857628962]
position = Vector2(1000, -248)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section11" type="StaticBody2D" parent="RightEdge" unique_id=277301703]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section11" unique_id=142331492]
position = Vector2(1000, -232)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section12" type="StaticBody2D" parent="RightEdge" unique_id=1038720437]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section12" unique_id=2027952296]
position = Vector2(1000, -216)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section13" type="StaticBody2D" parent="RightEdge" unique_id=1956319721]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section13" unique_id=668691165]
position = Vector2(1000, -200)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section14" type="StaticBody2D" parent="RightEdge" unique_id=58001227]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section14" unique_id=1544098744]
position = Vector2(1000, -184)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section15" type="StaticBody2D" parent="RightEdge" unique_id=72983216]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section15" unique_id=1423947441]
position = Vector2(1000, -168)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section16" type="StaticBody2D" parent="RightEdge" unique_id=1144035829]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section16" unique_id=1425757260]
position = Vector2(1000, -152)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section17" type="StaticBody2D" parent="RightEdge" unique_id=681667659]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section17" unique_id=222838920]
position = Vector2(1000, -136)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section18" type="StaticBody2D" parent="RightEdge" unique_id=641924861]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section18" unique_id=469857280]
position = Vector2(1000, -120)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section19" type="StaticBody2D" parent="RightEdge" unique_id=1922714949]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section19" unique_id=243878226]
position = Vector2(1000, -104)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section20" type="StaticBody2D" parent="RightEdge" unique_id=345064042]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section20" unique_id=235389123]
position = Vector2(1000, -88)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section21" type="StaticBody2D" parent="RightEdge" unique_id=981167330]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section21" unique_id=904832212]
position = Vector2(1000, -72)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section22" type="StaticBody2D" parent="RightEdge" unique_id=1142691048]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section22" unique_id=2039893709]
position = Vector2(1000, -56)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section23" type="StaticBody2D" parent="RightEdge" unique_id=1452456771]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section23" unique_id=964885666]
position = Vector2(1000, -40)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section24" type="StaticBody2D" parent="RightEdge" unique_id=1012857481]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section24" unique_id=1603234567]
position = Vector2(1000, -24)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section25" type="StaticBody2D" parent="RightEdge" unique_id=423875150]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section25" unique_id=590197771]
position = Vector2(1000, -8)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section26" type="StaticBody2D" parent="RightEdge" unique_id=1567920860]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section26" unique_id=900614103]
position = Vector2(1000, 8)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section27" type="StaticBody2D" parent="RightEdge" unique_id=1243173607]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section27" unique_id=933773121]
position = Vector2(1000, 24)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section28" type="StaticBody2D" parent="RightEdge" unique_id=1116514408]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section28" unique_id=956564400]
position = Vector2(1000, 40)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section29" type="StaticBody2D" parent="RightEdge" unique_id=905149913]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section29" unique_id=499370874]
position = Vector2(1000, 56)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section30" type="StaticBody2D" parent="RightEdge" unique_id=114733636]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section30" unique_id=1570176460]
position = Vector2(1000, 72)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section31" type="StaticBody2D" parent="RightEdge" unique_id=217438607]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section31" unique_id=1900110145]
position = Vector2(1000, 88)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section32" type="StaticBody2D" parent="RightEdge" unique_id=1325246043]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section32" unique_id=751552698]
position = Vector2(1000, 104)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section33" type="StaticBody2D" parent="RightEdge" unique_id=1724398269]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section33" unique_id=1152870676]
position = Vector2(1000, 120)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section34" type="StaticBody2D" parent="RightEdge" unique_id=1249014479]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section34" unique_id=268715988]
position = Vector2(1000, 136)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section35" type="StaticBody2D" parent="RightEdge" unique_id=1555294063]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section35" unique_id=1061710870]
position = Vector2(1000, 152)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section36" type="StaticBody2D" parent="RightEdge" unique_id=1882384714]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section36" unique_id=662024888]
position = Vector2(1000, 168)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section37" type="StaticBody2D" parent="RightEdge" unique_id=1225558742]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section37" unique_id=1199683463]
position = Vector2(1000, 184)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section38" type="StaticBody2D" parent="RightEdge" unique_id=1637593996]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section38" unique_id=1105242198]
position = Vector2(1000, 200)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section39" type="StaticBody2D" parent="RightEdge" unique_id=2043127277]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section39" unique_id=753703647]
position = Vector2(1000, 216)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section40" type="StaticBody2D" parent="RightEdge" unique_id=124930096]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section40" unique_id=1014998136]
position = Vector2(1000, 232)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section41" type="StaticBody2D" parent="RightEdge" unique_id=1317321533]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section41" unique_id=1837836194]
position = Vector2(1000, 248)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section42" type="StaticBody2D" parent="RightEdge" unique_id=268710488]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section42" unique_id=1967683827]
position = Vector2(1000, 264)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section43" type="StaticBody2D" parent="RightEdge" unique_id=1058978290]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section43" unique_id=1904914569]
position = Vector2(1000, 280)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section44" type="StaticBody2D" parent="RightEdge" unique_id=1302282680]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section44" unique_id=527489309]
position = Vector2(1000, 296)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section45" type="StaticBody2D" parent="RightEdge" unique_id=89371710]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section45" unique_id=2145439985]
position = Vector2(1000, 312)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section46" type="StaticBody2D" parent="RightEdge" unique_id=272073608]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section46" unique_id=1409500033]
position = Vector2(1000, 328)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section47" type="StaticBody2D" parent="RightEdge" unique_id=2136372528]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section47" unique_id=1723787819]
position = Vector2(1000, 344)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section48" type="StaticBody2D" parent="RightEdge" unique_id=1679313799]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section48" unique_id=804209730]
position = Vector2(1000, 360)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section49" type="StaticBody2D" parent="RightEdge" unique_id=1628776930]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section49" unique_id=1576094252]
position = Vector2(1000, 376)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Section50" type="StaticBody2D" parent="RightEdge" unique_id=1610674759]
physics_material_override = SubResource("PhysicsMaterial_7h2rc")
[node name="Bounds" type="CollisionShape2D" parent="RightEdge/Section50" unique_id=2042481999]
position = Vector2(1000, 392)
shape = SubResource("RectangleShape2D_7h2rc")
debug_color = Color(0.98836404, 0, 0.30800217, 0.41960785)
[node name="Map" parent="." unique_id=1033871459 instance=ExtResource("2_wqv88")]
+4 -4
View File
@@ -25,15 +25,15 @@ public partial class PlayerController : TurnController
public void SetUpTowers(int TOWER_COUNT = 8)
{
Tower tower = GetNode<Tower>("Tower1");
Vector2 towerPositionCorrection = tower._area.GetNode<CollisionShape2D>("Bounds").Shape.GetRect().Size / 2 * (Vector2.Right + Vector2.Up);
float spaceBetweenTowers = _grid._sizeInPixels.X / (TOWER_COUNT - 1);
tower.Position = _grid.Position - _grid._sizeInPixels / 2 + towerPositionCorrection;
Vector2 towerPositionCorrection = tower._offset.Position;
float spaceBetweenTowers = _playArea._map._sizeInPixels.X / (TOWER_COUNT - 1);
tower.GlobalPosition = _playArea._map.GlobalPosition - _playArea._map._sizeInPixels / 2 + towerPositionCorrection;
_towers.Add(tower);
for (int i = 1; i < TOWER_COUNT; i++)
{
Tower newTower = (Tower)tower.Duplicate();
newTower.Position += new Vector2(spaceBetweenTowers * i - towerPositionCorrection.X * i / (TOWER_COUNT - 1) * 2, 0);
newTower.GlobalPosition += new Vector2(spaceBetweenTowers * i - towerPositionCorrection.X * i / (TOWER_COUNT - 1) * 2, 0);
_towers.Add(newTower);
AddChild(newTower);
}
+46 -16
View File
@@ -1,46 +1,76 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Diagnostics;
public partial class Tower : Sprite2D
{
public bool _hovered, _aiming;
public Commander _commander;
public Vector2 _aimOffset;
public Marker2D _offset, _attackSpawn;
public Area2D _area;
public Commander _commander;
public override void _Ready()
{
base._Ready();
_area = GetNode<Area2D>("Area");
_offset = GetNode<Marker2D>("Offset");
_attackSpawn = GetNode<Marker2D>("AttackSpawn");
}
public override void _Process(double delta)
{
base._Process(delta);
if (_commander?._actions > 0)
{
if (_aiming)
{
if (Input.IsActionJustPressed("rightClick"))
{
_commander.UnloadAttack();
_aiming = false;
}
else if (Input.IsActionJustPressed("leftClick"))
{
_aimOffset = GetGlobalMousePosition() - GlobalPosition;
_commander.ShootCurrentAttack(_aimOffset);
_aiming = false;
}
}
if (Input.IsActionJustPressed("leftClick"))
{
if (_hovered)
{
_aiming = true;
_commander.LoadAttack();
}
}
if (_aiming)
{
if (Input.IsActionJustReleased("rightClick"))
{
Vector2 offset = (GlobalPosition - GetGlobalMousePosition()) * 500;
_commander.ShootCurrentAttack(offset);
_aiming = false;
}
else if (Input.IsActionJustReleased("leftClick"))
{
_commander.UnloadAttack();
_aiming = false;
_commander.LoadAttack(_attackSpawn.Position);
}
}
}
}
public List<Vector2> PredictPath()
{
Vector2 velocity = _aimOffset;
float timeBetweenSteps = 0.05f;
Vector2 startPosition = _attackSpawn.Position;
float gravity = -(float)ProjectSettings.GetSetting("physics/2d/default_gravity", 980.0f);
float drag = (float)ProjectSettings.GetSetting("physics/2d/default_linear_damp", 0.0f);
List<Vector2> points = [startPosition];
for (int i = 0; i < 151; i++)
{
velocity.Y += gravity * timeBetweenSteps;
// GD.Print(velocity);
velocity *= (float)Math.Clamp(1.0 - drag * timeBetweenSteps, 0, 1);
points.Add(points[^1] + velocity);
}
return points;
}
// public Dictionary<> Ra
public void OnMouseEntered(){
_hovered = true;
}
+1 -1
View File
@@ -5,7 +5,7 @@ public partial class TurnController : Node2D
{
[Signal]
public delegate void TurnDoneEventHandler();
public GridMap2D _grid;
public PlayArea _playArea;
public virtual void StartTurn()
{
+8 -2
View File
@@ -4,7 +4,9 @@
[ext_resource type="Texture2D" uid="uid://nwj4n7if8kqd" path="res://Art/circle25r.png" id="2_hqc8w"]
[sub_resource type="CircleShape2D" id="CircleShape2D_7yfhp"]
radius = 14.0
radius = 8.0
[sub_resource type="Curve2D" id="Curve2D_63pi1"]
[node name="Attack" type="RigidBody2D" unique_id=1225359241]
input_pickable = true
@@ -16,9 +18,13 @@ script = ExtResource("1_63pi1")
shape = SubResource("CircleShape2D_7yfhp")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1583277900]
scale = Vector2(0.56, 0.56)
scale = Vector2(0.32, 0.32)
texture = ExtResource("2_hqc8w")
[node name="PredictedPath" type="Path2D" parent="." unique_id=1505290715]
modulate = Color(1, 0, 1, 1)
curve = SubResource("Curve2D_63pi1")
[connection signal="body_entered" from="." to="." method="TakeAction"]
[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"]
[connection signal="mouse_exited" from="." to="." method="OnMouseExited"]
+2 -2
View File
@@ -7,10 +7,9 @@
bounce = 0.5
[sub_resource type="CircleShape2D" id="CircleShape2D_4gyqm"]
radius = 25.0
radius = 8.0
[node name="Enemy" type="StaticBody2D" unique_id=1417697759]
scale = Vector2(0.56, 0.56)
physics_material_override = SubResource("PhysicsMaterial_7k104")
script = ExtResource("1_4gyqm")
@@ -18,4 +17,5 @@ script = ExtResource("1_4gyqm")
shape = SubResource("CircleShape2D_4gyqm")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1941012605]
scale = Vector2(0.32, 0.32)
texture = ExtResource("1_7k104")
-850
View File
File diff suppressed because one or more lines are too long
-6
View File
@@ -1,6 +0,0 @@
[gd_scene format=3 uid="uid://bxqhci3fya80t"]
[ext_resource type="Script" uid="uid://cob0pwghnubxa" path="res://GridMarker.cs" id="1_u0re5"]
[node name="GridMarker" type="Marker2D" unique_id=1390656323 groups=["GridMarkers"]]
script = ExtResource("1_u0re5")
+2 -2
View File
@@ -1,14 +1,14 @@
[gd_scene format=3 uid="uid://dcp7p6al4i0b7"]
[ext_resource type="Script" uid="uid://cg1m762ed04kv" path="res://Main.cs" id="1_ig7tw"]
[ext_resource type="PackedScene" uid="uid://la8pwcc0tjuu" path="res://grid_map_2d.tscn" id="3_h2yge"]
[ext_resource type="PackedScene" uid="uid://la8pwcc0tjuu" path="res://PlayArea.tscn" id="3_h2yge"]
[ext_resource type="PackedScene" uid="uid://c6b188d2a20eq" path="res://enemy_controller.tscn" id="4_1bvp3"]
[ext_resource type="PackedScene" uid="uid://b7kvx7p0b2086" path="res://player_controller.tscn" id="4_lquwl"]
[node name="Main" type="Node" unique_id=535208469]
script = ExtResource("1_ig7tw")
[node name="GridMap2D" parent="." unique_id=1123610167 instance=ExtResource("3_h2yge")]
[node name="PlayArea" parent="." unique_id=1123610167 instance=ExtResource("3_h2yge")]
position = Vector2(960, 600)
[node name="EnemyController" parent="." unique_id=1894449838 instance=ExtResource("4_1bvp3")]
+7 -1
View File
@@ -4,7 +4,7 @@
[ext_resource type="Texture2D" uid="uid://32m5teus1cjj" path="res://Art/tower.png" id="1_vedim"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vedim"]
size = Vector2(50, 99)
size = Vector2(50, 100)
[node name="Tower" type="Sprite2D" unique_id=1315831332]
self_modulate = Color(0, 0, 0, 1)
@@ -18,5 +18,11 @@ position = Vector2(0, 0.5)
shape = SubResource("RectangleShape2D_vedim")
debug_color = Color(0.6411928, 0.52469516, 0, 0.41960785)
[node name="Offset" type="Marker2D" parent="." unique_id=2053853274]
position = Vector2(25, -50)
[node name="AttackSpawn" type="Marker2D" parent="." unique_id=715904909]
position = Vector2(0, 50)
[connection signal="mouse_entered" from="Area" to="." method="OnMouseEntered"]
[connection signal="mouse_exited" from="Area" to="." method="OnMouseExited"]