diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-12-30 11:41:09 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-12-30 11:41:14 +0100 |
commit | 24a8f1b156ea92e7b0ad60052521e1430a77e13f (patch) | |
tree | e2e21d5015e8003e6ba40dc85a19bc9d523e249f /stage/tile_map_layer.gd | |
parent | 474ef692613f298ab05bbb65ad85625f178b63cc (diff) |
Diffstat (limited to 'stage/tile_map_layer.gd')
-rw-r--r-- | stage/tile_map_layer.gd | 15 |
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 |