added debug tile placing on grid
This commit is contained in:
@@ -36,12 +36,17 @@ public class Player : KinematicBody2D
|
||||
|
||||
public override async void _Process(float delta)
|
||||
{
|
||||
//player coordinates on foregroundgrid
|
||||
var coordinates = GetNode<TileMap>("/root/Main/World/Foreground").WorldToMap(Position);
|
||||
//debug the grid
|
||||
var tilemap = GetNode<TileMap>("/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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user