chunk class was missing set_tileset() ...

This commit is contained in:
Antti Hakkarainen 2023-02-12 19:12:27 +02:00
parent abbaa6f450
commit fccef57210
7 changed files with 39 additions and 50 deletions

View file

@ -4,7 +4,7 @@
extends Node
# world map chunk size
const CHUNK_SIZE:int = 128
const CHUNK_SIZE:int = 16
# tilemap tile types
enum {TILE_WATER, TILE_TERRAIN, TILE_FOREST, TILE_BOG}
@ -12,6 +12,8 @@ enum {TILE_WATER, TILE_TERRAIN, TILE_FOREST, TILE_BOG}
# tilemap layers
enum {LAYER_TERRAIN, LAYER_BUILDINGS}
const TILESET_TERRAIN:TileSet = preload("res://scenes/Chunk.tres")
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]