ld-56/src/zone.gd

21 lines
503 B
GDScript3
Raw Normal View History

2024-10-07 05:05:27 +00:00
extends Window
var key
@onready var data = Data.data.zones[key]
@onready var image = Data.data.images[key]
@onready var sprite_2d: Sprite2D = $Sprite2D
const CREATURE = preload("res://src/Creature.tscn")
func _ready() -> void:
title = data.name
sprite_2d.texture = image
sprite_2d.position = Vector2(int(data.size[0]) * 12 / 2, int(data.size[1]) * 12 / 2)
var new_creature = CREATURE.instantiate()
new_creature.position = Vector2(50, 50)
new_creature.key = "1x1-1"
add_child(new_creature)