mirror of
https://github.com/HarmonyHoney/tiny_crate.git
synced 2026-01-23 18:47:03 +00:00
18 lines
407 B
GDScript
18 lines
407 B
GDScript
extends TileMap
|
|
|
|
|
|
var scene_spike = preload("res://Scene/Spike.tscn")
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
Shared.node_map_spike = self
|
|
|
|
for pos in get_used_cells():
|
|
#print("creating spike from tile: ", pos)
|
|
var cell = cell_size.x
|
|
var inst = scene_spike.instance()
|
|
inst.position = Vector2(pos.x * cell, pos.y * cell + 5)
|
|
add_child(inst)
|
|
clear()
|
|
|
|
|