Destructible terrain!
This commit is contained in:
parent
cc80783d16
commit
9f224b3d69
9 changed files with 1548 additions and 188 deletions
18
utilities/GridUtilitiesClass.gd
Normal file
18
utilities/GridUtilitiesClass.gd
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue