mirror of
https://git.kittycat.homes/zoe/codename-routes.git
synced 2024-08-15 03:18:26 +00:00
random world generation lmao (it is just entirely random)
This commit is contained in:
parent
f2d449a827
commit
61f952664d
2 changed files with 4 additions and 3 deletions
|
@ -1,8 +1,8 @@
|
|||
extends TileMap
|
||||
|
||||
func set_tile_graphics(pos: Vector2, id: int):
|
||||
var flip = true
|
||||
set_cell(pos.x,pos.y,0,false,false,false,get_atlas_vec_for_id(id))
|
||||
if id == 0: set_cellv(pos, -1)
|
||||
set_cellv(pos,0,false,false,false,get_atlas_vec_for_id(id))
|
||||
|
||||
func get_atlas_vec_for_id(id: int) -> Vector2:
|
||||
return Vector2(randi() % 4, id)
|
||||
|
|
|
@ -24,7 +24,8 @@ func update_tiles(tile_positions: PoolVector3Array):
|
|||
if !StateServer.is_tile_hidden(int(tile.x), int(tile.y), int(tile.z)):
|
||||
tilemaps[tile.z].set_tile_graphics(Vector2(tile.x, tile.y),
|
||||
get_tile_at(tile))
|
||||
else: print("hidden tile hehe")
|
||||
for map in tilemaps:
|
||||
map.update_dirty_quadrants()
|
||||
|
||||
func _on_StateServer_request_init():
|
||||
call_deferred("respawn_tilemaps")
|
||||
|
|
Loading…
Reference in a new issue