extends Node2D

export(PackedScene) var enemy_ = preload('res://Healthpickup.tscn')
var chance = 0.1
var arg = true

func _on_Health_die():
	if arg:
		arg = false
		var n = randf()
		print(n)
		if n < chance:
			print('spawn carne')
			var enemy = enemy_.instance()
			get_parent().get_parent().call_deferred('add_child',enemy)
			enemy.get_node('Sprite').texture = load('res://Carne.png')
			enemy.global_position = global_position
		yield(Timergen.createtime(self,1.0), 'timeout')
		get_parent().queue_free()
	pass # Replace with function body.
