extends Camera2D
signal triggered

onready var player = $"../Player"

func fix_camera():
	if player.lives > 0:
		var diff = player.position - get_camera_position()
		while diff.x > 250.0:
			move_local_x(200)
			diff.x -= 200
		while diff.x < 50.0:
			move_local_x(-200)
			diff.x += 200
		while diff.y > 160:
			move_local_y(150)
			diff.y -= 150
		while diff.y < 0:
			move_local_y(-150)
			diff.y += 150
		emit_signal("triggered")
