class_name Grenade extends RigidBody2D

var timer = Timer.new()

func _ready():
	add_child(timer)
	
	timer.wait_time =  2
	
	timer.one_shot = true
	timer.connect("timeout", explode)
	timer.start()

func explode():
	print("HEHEHE EXPLODE TIME")
	self.queue_free()


func _on_body_entered(body):
	print("collision with grenade")
	if body.is_in_group("Destructable"):
		body.queue_free()
		explode()
