summaryrefslogtreecommitdiff
path: root/scripts/Utils/Grid.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-08-17 19:32:36 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-08-17 19:32:36 -0300
commitca782d7310f2df854a8727535ac92337c85ed445 (patch)
tree7df571c01d48cac56fb8362d4d091bdd2a55c09a /scripts/Utils/Grid.cs
parentadb86dd1725276457c13e9a4d37372fda628dea3 (diff)
Gigantesco refactor
Diffstat (limited to 'scripts/Utils/Grid.cs')
-rw-r--r--scripts/Utils/Grid.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/Utils/Grid.cs b/scripts/Utils/Grid.cs
new file mode 100644
index 0000000..bf5d98f
--- /dev/null
+++ b/scripts/Utils/Grid.cs
@@ -0,0 +1,14 @@
+using Godot;
+using System;
+
+public partial class Grid : GodotObject {
+ public static readonly Vector2I tileSize = new(16, 16);
+
+ public static Vector2I WorldToGrid(Vector2 coord) {
+ return (Vector2I)(coord / tileSize);
+ }
+
+ public static Vector2 GridToWorld(Vector2I coord) {
+ return coord * tileSize;
+ }
+}