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 Bucket _bucket; public override void _Ready() { base._Ready(); _bucket = GetNode("Bucket"); _region = GetNode("Region"); _leftEdge = GetNode("LeftEdge"); _rightEdge = GetNode("RightEdge"); CollisionShape2D regionBounds = _region.GetNode("Bounds"); _map = GetNode("Map"); } public override void _Process(double delta) { base._Process(delta); _bucket.Move(); } public void HighlightCells() { TileMapLayer occupiedSpaces = GetNode("OccupiedSpaces"); _map._cells.ForEach(c => { if (_map.HasOccupant(c)) { occupiedSpaces.SetCell(c, 0, new Vector2I(4,0)); } else if (_map._astar.IsPointSolid(c)) { } else { occupiedSpaces.SetCell(c, 0, Vector2I.Down*4); } }); } }