summaryrefslogtreecommitdiff
path: root/stage/tile_map_layer.gd
diff options
context:
space:
mode:
Diffstat (limited to 'stage/tile_map_layer.gd')
-rw-r--r--stage/tile_map_layer.gd15
1 files changed, 15 insertions, 0 deletions
diff --git a/stage/tile_map_layer.gd b/stage/tile_map_layer.gd
new file mode 100644
index 0000000..456cfaa
--- /dev/null
+++ b/stage/tile_map_layer.gd
@@ -0,0 +1,15 @@
+extends TileMapLayer
+
+
+func is_wall(collision_point: Vector2):
+ var map_coordinates := local_to_map(collision_point)
+ var tile = get_cell_tile_data(map_coordinates)
+
+ return tile.get_collision_polygons_count(0) > 0
+
+
+func is_ledge(collision_point: Vector2):
+ var map_coordinates := local_to_map(collision_point)
+ var tile = get_cell_tile_data(map_coordinates)
+
+ return tile.get_collision_polygons_count(1) > 0