2021-04-05 20:59:49 +00:00
|
|
|
extends TileMap
|
|
|
|
|
2021-04-25 10:36:01 +00:00
|
|
|
onready var player = get_node("/root/base_scene/Player")
|
2021-04-05 20:59:49 +00:00
|
|
|
|
|
|
|
func _ready():
|
2021-04-25 10:36:01 +00:00
|
|
|
print(self.tile_set.get_tiles_ids())
|
2021-04-05 20:59:49 +00:00
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
func _get_cell_size():
|
|
|
|
return cell_size
|
|
|
|
|
|
|
|
func _unhandled_input(event):
|
|
|
|
var pl_pos = player.position
|
|
|
|
var pl_pos_tile = Vector2(pl_pos.x / cell_size.x, pl_pos.y / cell_size.y)
|
|
|
|
var pl_tile = get_cellv(pl_pos_tile)
|
|
|
|
if event == Input.action_press("map_interaction"):
|
|
|
|
if(pl_tile != -1):
|
|
|
|
set_cellv(pl_pos_tile, -1)
|
|
|
|
|
2021-05-28 21:01:56 +00:00
|
|
|
func _on_Settings_pressed():
|
|
|
|
Global.GoToScene("menu")
|
|
|
|
|
2021-08-26 14:52:21 +00:00
|
|
|
func _on_Inventory_released():
|
2021-05-26 20:59:30 +00:00
|
|
|
var inventory_screen = preload("res://MiscScenes/Inventory.tscn").instance()
|
|
|
|
Global.AddScene(inventory_screen, "inventory_screen", true)
|
2021-08-26 14:52:21 +00:00
|
|
|
|