mirror of
https://github.com/Yadciel1/2048-Shooter.git
synced 2024-11-12 17:11:18 +01:00
25 lines
470 B
GDScript
25 lines
470 B
GDScript
extends Panel
|
|
|
|
var PanzerType = preload("res://Panzer.tscn")
|
|
var Panzer = null
|
|
|
|
func _ready():
|
|
if randi() % 2 == 0:
|
|
Panzer = PanzerType.instance()
|
|
add_child(Panzer)
|
|
|
|
|
|
func pickFromSlot():
|
|
remove_child(Panzer)
|
|
var GameNode = find_parent("Game")
|
|
GameNode.add_child(Panzer)
|
|
Panzer = null
|
|
|
|
func putIntoSlot(new_panzer):
|
|
Panzer = new_panzer
|
|
Panzer.position = Vector2(64, 64)
|
|
var GameNode = find_parent("Game")
|
|
GameNode.remove_child(Panzer)
|
|
add_child(Panzer)
|
|
|