1
0
Fork 0
gai-ca2/project/scripts/tilemap/World.gd

34 lines
1.2 KiB
GDScript

class_name World
extends Node2D
var tilemap_ground: TileMapLayerAccess = TileMapLayerAccess.new()
var tilemap_non_interactive: TileMapLayerAccess = TileMapLayerAccess.new()
var tilemap_interactive: TileMapLayerAccess = TileMapLayerAccess.new()
var tilemap_player: TileMapLayerAccess = TileMapLayerAccess.new()
var tilemap_temperature: TileMapLayerAccess = TileMapLayerAccess.new()
#
var tilemap_types: TileMapTileTypes = TileMapTileTypes.new()
func _ready() -> void:
tilemap_ground.tilemap = $GroundLayer
tilemap_non_interactive.tilemap = $NonInteractiveObjectsLayer
tilemap_interactive.tilemap = $InteractiveObjectsLayer
tilemap_player.tilemap = $PlayerLayer
tilemap_temperature.tilemap = $TemperatureLayer
tilemap_ground.setup()
tilemap_non_interactive.setup()
tilemap_interactive.setup()
tilemap_player.setup()
tilemap_temperature.setup()
# print(tilemap_non_interactive.get_cells_by_custom_data("walkable", true))
# tilemap_ground.clear_cells()
# tilemap_ground.set_cell(Vector2i(0, 0), tilemap_types.GRASS)
func _process(delta: float) -> void:
print(tilemap_ground.local_to_cell(get_local_mouse_position()))