diff --git a/src/Player.cs b/src/Player.cs index b1a0429..166453c 100644 --- a/src/Player.cs +++ b/src/Player.cs @@ -36,12 +36,17 @@ public class Player : KinematicBody2D public override async void _Process(float delta) { - //player coordinates on foregroundgrid - var coordinates = GetNode("/root/Main/World/Foreground").WorldToMap(Position); + //debug the grid + var tilemap = GetNode("/root/Main/World/Foreground"); + Vector2 coordinates = tilemap.WorldToMap(Position); if (Input.IsKeyPressed((int)KeyList.F3)) { GD.Print(coordinates); } + if (Input.IsKeyPressed((int)KeyList.F2)) + { + tilemap.SetCell((int)coordinates.x, (int)coordinates.y, 1); + } } }