Destructible terrain!

This commit is contained in:
Dan 2024-06-02 15:39:46 +01:00
parent cc80783d16
commit 9f224b3d69
9 changed files with 1548 additions and 188 deletions

View file

@ -0,0 +1,18 @@
extends Node
class_name GridUtilitiesClass
## Get the tile coordinates of the surrounding tiles of the given tile
func get_surrounding_tiles(given_tile : Vector2, spread : int = 3) -> Array:
var surrounding_tiles : Array[Vector2] = []
var target_tile : Vector2
for y in spread:
for x in spread:
target_tile = given_tile + Vector2(x - 1, y - 1)
#if given_tile == target_tile:
# continue
surrounding_tiles.append(target_tile)
return surrounding_tiles