extends Area2D

var type = "body"

var poses_x = [13, 15]

var y_speed = 32
var x_speed = 0

var pos_x = 0
var y = 0
var new_y = 0

var dir_x

var limits = Vector2(0, 29)

func _process(delta):
	new_y += y_speed * delta
	if ceil(y) != ceil(new_y):
		y = new_y
		position.y += 1
		
func _on_area_entered(area):
	area.destroy()
	yield(get_tree().create_timer(0.15), "timeout")

func _ready():
	$life_time.connect("timeout", self, "queue_free")
	$life_time.start()
	global_position.x = poses_x[randi() % 2]
	self.connect("area_entered", self, "_on_area_entered")
