Peashooters
This commit is contained in:
parent
161f87da75
commit
68cfe89f1d
47 changed files with 1571 additions and 279 deletions
|
|
@ -1,4 +1,4 @@
|
|||
extends CanvasGroup
|
||||
extends Node2D
|
||||
|
||||
@export var entity_container : LayeredEntityContainer
|
||||
var can_plant : bool = false
|
||||
|
|
@ -24,13 +24,16 @@ func _input(event: InputEvent) -> void:
|
|||
|
||||
if held_packet != null and can_plant and event.is_action_pressed("primary_action"):
|
||||
for child in get_children():
|
||||
child.enable()
|
||||
child.reparent(get_tree().current_scene.get_node("%Plants"))
|
||||
LevelEventBus.packet_placed.emit(held_packet)
|
||||
held_packet = null
|
||||
visible = false
|
||||
|
||||
func on_seedpacket_selected(packet : SeedpacketResource) -> void:
|
||||
add_child(packet.scene.instantiate())
|
||||
var instantiated = packet.scene.instantiate()
|
||||
add_child(instantiated)
|
||||
instantiated.disable()
|
||||
held_packet = packet
|
||||
visible = true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue