refactor worldgen to class, make worldgen functional

This commit is contained in:
Antti Hakkarainen 2023-02-09 22:20:23 +02:00
parent 5cb839d8e2
commit 7651e574c1
5 changed files with 248 additions and 126 deletions

View file

@ -3,6 +3,16 @@
extends Node
enum {TILE_WATER, TILE_TERRAIN, TILE_FOREST, TILE_BOG}
func are_coords_valid(value:int, bounds:Vector2i, errmsg:String) -> bool:
if bounds.x > value or value > bounds.y:
errmsg = errmsg % [value, bounds.x, bounds.y]
push_error(errmsg)
return false
return true
var world_map: TileMap
var map_image_size:Vector2i