tmp commit
This commit is contained in:
@@ -1,11 +1,19 @@
|
|||||||
extends Sprite2D
|
extends Sprite2D
|
||||||
|
|
||||||
|
var producer_value: int
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
print("Placed Extractor at: (%s, %s)" % [self.global_position[0], self.global_position[1]])
|
print("Placed Extractor at: (%s, %s)" % [self.global_position[0], self.global_position[1]])
|
||||||
|
|
||||||
|
func setup(producer_value):
|
||||||
|
producer_value = producer_value
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _on_timer_timeout() -> void:
|
||||||
|
print("Extractor producing %s" % producer_value)
|
||||||
|
$Timer.start()
|
||||||
|
|||||||
@@ -208,6 +208,12 @@ func place_item(item: PackedScene):
|
|||||||
{
|
{
|
||||||
"type": new_item.name,
|
"type": new_item.name,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Custom setup needed
|
||||||
|
if item == EXTRACTOR_SCENE:
|
||||||
|
new_item.setup(object_at_coords['value'])
|
||||||
|
else:
|
||||||
|
print("No custom setup for %s" % item)
|
||||||
|
|
||||||
func delete_item(target_pos: Vector2i):
|
func delete_item(target_pos: Vector2i):
|
||||||
var targets = get_tree().get_nodes_in_group("Placed_objects")
|
var targets = get_tree().get_nodes_in_group("Placed_objects")
|
||||||
|
|||||||
Reference in New Issue
Block a user