feat: hexagonal ant
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
extends TileMapLayer
|
||||
|
||||
var tiles: Dictionary = {}
|
||||
var idx: int = 0
|
||||
var dirs: Array[int] = [
|
||||
TileSet.CELL_NEIGHBOR_TOP_RIGHT_SIDE,
|
||||
TileSet.CELL_NEIGHBOR_RIGHT_SIDE,
|
||||
TileSet.CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE,
|
||||
TileSet.CELL_NEIGHBOR_BOTTOM_LEFT_SIDE,
|
||||
TileSet.CELL_NEIGHBOR_LEFT_SIDE,
|
||||
TileSet.CELL_NEIGHBOR_TOP_LEFT_SIDE,
|
||||
]
|
||||
|
||||
func render_next() -> void:
|
||||
print("rendering {i}")
|
||||
set_cell(get_neighbor_cell(Vector2i(0, 0), dirs[idx]), 0, Vector2i(0, 1))
|
||||
idx = (idx + 1) % 6
|
||||
|
||||
func get_tile_colour(pos: Vector2i) -> int:
|
||||
return tiles.get_or_add(pos, 0)
|
||||
|
||||
Reference in New Issue
Block a user