1
0
Fork 0
gai-ca2/project/scripts/player/PlayerManager.gd

20 lines
565 B
GDScript

class_name PlayerManager
extends Node
var board_position: Vector2 = Vector2(0, 0)
var world: World = null
var camera: Camera2D = null
#
var tilemap_types: TileMapTileTypes = TileMapTileTypes.new()
func _ready() -> void:
call_deferred("update_board")
func _process(delta: float) -> void:
if Input.is_action_just_pressed("key_3"):
camera.go_to_zooming(world.tilemap_player.cell_to_local(board_position), 2)
func update_board() -> void:
world.tilemap_player.clear_cells()
world.tilemap_player.set_cell(board_position, tilemap_types.PLAYER)