Arena.MoveToAndResize(320, -5, 640, 480, true, true)
Player.sprite.alpha = 0
Cube = CreateSprite("JS&B Library Sprites/Cube/1","BelowBullet")
Cube.color = {0,1,1}
Cube.Scale(16/46, 16/46)
Player.SetControlOverride(true)

Cegador = CreateSprite("Pixel", "Top")
Cegador.Scale(640, 480)
Cegador.MoveTo(320, 240)
Cegador.alpha = 0
Muerte = CreateSprite("Pixel", "Top")
Muerte.Scale(640, 480)
Muerte.MoveTo(320, 240)
Muerte.alpha = 0
Cargador = CreateSprite("JS&B Library Sprites/Cube/1","Bottom")
for i=1,88 do
	Cargador.Set("JS&B Library Sprites/Cube/"..i)
end
for i=1,88 do
	Cargador.Set("JS&B Library Sprites/Meter/"..i)
end
for i=1,6 do
	Cargador.Set("JS&B Library Sprites/Explotion/"..i)
end
Cargador.Set("JS&B Library Sprites/Circle")
Cargador.Set("JS&B Library Sprites/Death")
Cargador.Set("JS&B Library Sprites/Explosive")
Cargador.Set("JS&B Library Sprites/Eye")
Cargador.Set("JS&B Library Sprites/Hole")
Cargador.Set("JS&B Library Sprites/Saw")
Cargador.Set("JS&B Library Sprites/Bullet")
Cargador.Set("JS&B Library Sprites/Triangulo")
Cargador.Set("JS&B Library Sprites/CheckPoint")
Cargador.Remove()
Cargador = nil

PosX = 160
PosY = 240
maxhits = 3
hits = 0
frame = 1
BGcolor = {0,0,0}
tableaux = 0

Bullets = {}
Death = {}
Explotions = {}
Circles = {}
Barras = {}
Barras2 = {}
Barras3 = {}
Fall = {}
Caida = {}
GeneraMontes = {}
Montes = {}
Generator = {}
Snake = {}
Movement = {}
Warnings = {}
Zoom_in_out = {}
Appear = {}
CheckPoints2 = {}

function JSB()
	if Long then
		Long = Long + 1
		if Long <= 30 then
			if not Triangulo then
				Triangulo = CreateSprite("JS&B Library Sprites/Medidor/Triangulo","Top")
			end
			Triangulo.MoveTo(168, 488 - 20*math.sin(math.rad(90/30*Long)))
		elseif Long > 30 and Long <= 60 then
			if not Anim1 and not Anim2 then
				Anim1 = CreateSprite("Pixel", "Top")
				Anim2 = CreateSprite("Pixel", "Top")
				Anim1.Scale(16, 16)
				Anim2.Scale(0, 16)
				Anim1.color = {0, 102/255, 102/255}
				Anim2.color = {0, 102/255, 102/255}
				Anim1.alpha = 0
				Anim2.alpha = 0
			end
			Triangulo.MoveTo(320 - 152*math.cos(math.rad(180/30*(Long - 30))), 468)
			Anim1.MoveTo(320 - 152*math.cos(math.rad(180/30*(Long - 30))), 468)
			Anim2.xscale = 152 - 152*math.cos(math.rad(180/30*(Long - 30)))
			Anim2.MoveTo(160 + Anim2.xscale/2, 468)
			Anim1.alpha = math.min(Anim1.alpha + 0.02, 0.5)
			Anim2.alpha = math.min(Anim2.alpha + 0.02, 0.5)
		elseif Long > 60 and Long <= 90 then
			if not MedidorT and not IndicadorM then
				MedidorT = CreateSprite("JS&B Library Sprites/Medidor/Medidor","Top")
				for i=1,#CheckPoints do
					local sprite = CreateSprite("JS&B Library Sprites/Medidor/Checkpoint","Top")
					sprite.MoveTo(168 + 304/Largo*CheckPoints[i], 468)
					sprite.SetVar("Data", {CheckPoints[i], false})
					sprite.alpha = 0
					table.insert(CheckPoints2, sprite)
					CheckPoints[i] = false
				end
				IndicadorM = CreateSprite("JS&B Library Sprites/Medidor/Cubo","Top")
				MedidorT.MoveTo(320, 468)
				MedidorT.alpha = 0
				IndicadorM.alpha = 0
			end
			Anim1.alpha = Anim1.alpha - 0.02
			Anim2.alpha = Anim2.alpha - 0.02
			MedidorT.alpha = math.min(MedidorT.alpha + 0.01, 0.25)
			IndicadorM.alpha = IndicadorM.alpha + 0.04
			for i=1,#CheckPoints2 do
				CheckPoints2[i].alpha = CheckPoints2[i].alpha + 0.04
			end
			if Long == 90 then
				Anim1.Remove()
				Anim2.Remove()
				Anim1 = nil
				Anim2 = nil
				Long = nil
			end
		end
	end
	if Unlong and not Long then
		if Triangulo then
			Unlong = Unlong + 1
			if Unlong <= 30 then
				if not Anim1 and not Anim2 then
					Anim1 = CreateSprite("Pixel", "Top")
					Anim2 = CreateSprite("Pixel", "Top")
					Anim1.Scale(16, 16)
					Anim2.Scale(304, 16)
					Anim1.color = {0, 102/255, 102/255}
					Anim2.color = {0, 102/255, 102/255}
					Anim1.MoveTo(472, 468)
					Anim2.MoveTo(312, 468)
					Anim1.alpha = 0
					Anim2.alpha = 0
				end
				Anim1.alpha = math.min(Anim1.alpha + 0.02, 0.5)
				Anim2.alpha = math.min(Anim2.alpha + 0.02, 0.5)
				MedidorT.alpha = MedidorT.alpha - 0.01
				IndicadorM.alpha = IndicadorM.alpha - 0.04
				for i=1,#CheckPoints2 do
					CheckPoints2[i].alpha = CheckPoints2[i].alpha - 0.04
				end
				if Unlong == 30 then
					MedidorT.Remove()
					IndicadorM.Remove()
					MedidorT = nil
					IndicadorM = nil
					for i=1,#CheckPoints2 do
						CheckPoints2[i].Remove()
					end
					CheckPoints2 = {}
				end
			elseif Unlong > 30 and Unlong <= 60 then
				Triangulo.MoveTo(320 + 152*math.cos(math.rad(180/30*(Unlong - 30))), 468)
				Anim1.MoveTo(320 + 152*math.cos(math.rad(180/30*(Unlong - 30))), 468)
				Anim2.xscale = 152 + 152*math.cos(math.rad(180/30*(Unlong - 30)))
				Anim2.MoveTo(160 + Anim2.xscale/2, 468)
				if Unlong == 60 then
					Anim1.Remove()
					Anim2.Remove()
					Anim1 = nil
					Anim2 = nil
				elseif Unlong > 35 then
					Anim1.alpha = Anim1.alpha - 0.02
					Anim2.alpha = Anim2.alpha - 0.02
				end
			elseif Unlong > 60 and Unlong <= 90 then
				Triangulo.MoveTo(168, 488 - 20*math.cos(math.rad(90/30*(Unlong - 60))))
				if Unlong == 90 then
					Triangulo.Remove()
					Triangulo = nil
					Unlong = nil
				end
			end
		else
			Unlong = nil
		end
	end
	if IndicadorM then
		if SongTime > Largo or (timer > Empezar and NewAudio.isStopped("Song")) and not Unlong then
			Unlong = 0
		end
		if NewAudio.isStopped("Song") and timer > Empezar then
			IndicadorM.MoveTo(472, 468)
		else
			IndicadorM.MoveTo(168 + 304/Largo*math.min(SongTime, Largo), 468)
		end
	end
	for i=1,#Appear do
		local Datos = Appear[i - tableaux]
		if not Datos.PX and not Datos.PY then
			Datos.PX = Datos.X
			Datos.PY = Datos.Y
		end
		if Scroll and not Datos.Absoluto then
			if Datos.Direction then
				Datos.PX = Datos.PX + Scroll.X*NewAudio.GetPitch("Song")
				Datos.PY = Datos.PY + Scroll.Y*NewAudio.GetPitch("Song")
			else
				Datos.X = Datos.X + Scroll.X*NewAudio.GetPitch("Song")
				Datos.Y = Datos.Y + Scroll.Y*NewAudio.GetPitch("Song")
			end
		end
		if Datos.Direction then
			Datos.X = Datos.PX + Datos.Vel*math.cos(math.rad(Datos.Direction))*60*(SongTime - Datos.Initial)
			Datos.Y = Datos.PY + Datos.Vel*math.sin(math.rad(Datos.Direction))*60*(SongTime - Datos.Initial)
		end
		if not Datos.Layer then
			Datos.Layer = "BelowPlayer"
			Datos.Bullet.sprite.layer = "BelowPlayer"
		end
		Datos.Bullet.MoveToAbs(Datos.X, Datos.Y)
		Datos.Bullet.sprite.rotation = Datos.Bullet.sprite.rotation + (Datos.VelRot or 0)*NewAudio.GetPitch("Song")
		if SongTime < Datos.Initial then
			Datos.Bullet.Remove()
			table.remove(Appear, i - tableaux)
			tableaux = tableaux + 1
		elseif SongTime <= Datos.Initial + Datos.Delay then
			if Datos.Layer ~= "BelowPlayer" then
				Datos.Layer = "BelowPlayer"
				Datos.Bullet.sprite.layer = "BelowPlayer"
			end
			Datos.Bullet.SetVar("NoDamage", 1)
			Datos.Bullet.sprite.Scale(Datos.Scale, Datos.Scale)
			if not Datos.NoColor then
				Datos.Bullet.sprite.color = {1, 32/255, 112/255}
			end
			Datos.Bullet.sprite.alpha = (0.4 + 0.1*math.sin(math.rad(360/0.25*SongTime)))/Datos.Delay*(SongTime - Datos.Initial)
		elseif SongTime <= Datos.Initial + Datos.Delay + 0.1 then
			if Datos.Layer ~= "BelowBullet" then
				Datos.Layer = "BelowBullet"
				Datos.Bullet.sprite.layer = "BelowBullet"
			end
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Bullet.sprite.Scale(Datos.Scale + Datos.Increase*math.sin(math.rad(180/0.1*(SongTime - (Datos.Initial + Datos.Delay)))), Datos.Scale + Datos.Increase*math.sin(math.rad(180/0.1*(SongTime - (Datos.Initial + Datos.Delay)))))
			if not Datos.NoColor then
				Datos.Bullet.sprite.color = {1, (32 + 223*math.sin(math.rad(180/0.1*(SongTime - (Datos.Initial + Datos.Delay)))))/480, (112 + 143*math.sin(math.rad(180/0.1*(SongTime - (Datos.Initial + Datos.Delay)))))/480}
			end
			if Datos.Bullet.sprite.alpha < 1 and Datos.Shake then
				shakescreen = 0
				rango = Datos.Shake
			end
			Datos.Bullet.sprite.alpha = 1
		elseif SongTime <= Datos.Initial + Datos.Delay + Datos.Stay + 0.1 then
			if Datos.Layer ~= "BelowBullet" then
				Datos.Layer = "BelowBullet"
				Datos.Bullet.sprite.layer = "BelowBullet"
			end
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Bullet.sprite.Scale(Datos.Scale, Datos.Scale)
			if not Datos.NoColor then
				Datos.Bullet.sprite.color = {1, 32/255, 112/255}
			end
			Datos.Bullet.sprite.alpha = 1
		elseif SongTime <= Datos.Initial + Datos.Delay + Datos.Stay + 0.2 then
			if Datos.Layer ~= "BelowBullet" then
				Datos.Layer = "BelowBullet"
				Datos.Bullet.sprite.layer = "BelowBullet"
			end
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Bullet.sprite.Scale(Datos.Scale*math.cos(math.rad(90/0.1*(SongTime - (Datos.Initial + Datos.Delay + Datos.Stay + 0.1)))), Datos.Scale*math.cos(math.rad(90/0.1*(SongTime - (Datos.Initial + Datos.Delay + Datos.Stay + 0.1)))))
			if not Datos.NoColor then
				Datos.Bullet.sprite.color = {1, 32/255, 112/255}
			end
			Datos.Bullet.sprite.alpha = 1
		else
			Datos.Bullet.Remove()
			table.remove(Appear, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Zoom_in_out do
		local Datos = Zoom_in_out[i - tableaux]
		if not Datos.Bullet.GetVar("NoDamage") then
			Datos.Bullet.SetVar("NoDamage", 1)
		end
		if not Datos.NoDamage then
			Datos.Bullet.SetVar("NoDamage", Datos.Bullet.GetVar("NoDamage") - 1)
		end
		if Scroll and not Datos.Absoluto then
			Datos.X = Datos.X + Scroll.X*NewAudio.GetPitch("Song")
			Datos.Y = Datos.Y + Scroll.Y*NewAudio.GetPitch("Song")
		end
		Datos.Bullet.MoveToAbs(Datos.X, Datos.Y)
		if SongTime < Datos.SpawnTime then
			Datos.Bullet.Remove()
			table.remove(Zoom_in_out, i - tableaux)
			tableaux = tableaux + 1
		elseif SongTime <= Datos.SpawnTime + Datos.In then
			Datos.Bullet.sprite.Scale(Datos.Scale*math.sin(math.rad(90/Datos.In*(SongTime - Datos.SpawnTime))), Datos.Scale*math.sin(math.rad(90/Datos.In*(SongTime - Datos.SpawnTime))))
		elseif SongTime <= Datos.SpawnTime + Datos.In + Datos.Stay then
			Datos.Bullet.sprite.Scale(Datos.Scale, Datos.Scale)
		elseif SongTime <= Datos.SpawnTime + Datos.In + Datos.Stay + Datos.Out then
			Datos.Bullet.sprite.Scale(Datos.Scale*math.cos(math.rad(90/Datos.Out*(SongTime - (Datos.SpawnTime + Datos.In + Datos.Stay)))), Datos.Scale*math.cos(math.rad(90/Datos.Out*(SongTime - (Datos.SpawnTime + Datos.In + Datos.Stay)))))
		else
			Datos.Bullet.Remove()
			table.remove(Zoom_in_out, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Warnings do
		local Datos = Warnings[i - tableaux]
		Datos.Sprite.MoveTo(Datos.X, Datos.Y)
		Datos.Sprite.alpha = 0.2 + 0.05*math.sin(math.rad(360/0.25*SongTime))
		if SongTime < Datos.Appear or SongTime > Datos.Disappear then
			Datos.Sprite.Remove()
			table.remove(Warnings, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Caida do
		local Datos = Caida[i - tableaux]
		if Scroll and not Datos.Absoluto then
			Datos.X = Datos.X + Scroll.X*NewAudio.GetPitch("Song")
			Datos.Y = Datos.Y + Scroll.Y*NewAudio.GetPitch("Song")
		end
		if not Datos.Bullet.GetVar("NoDamage") then
			Datos.Bullet.SetVar("NoDamage", 1)
		end
		Datos.Bullet.SetVar("NoDamage", Datos.Bullet.GetVar("NoDamage") - 1)
		Datos.X = Datos.X + Datos.Vel*NewAudio.GetPitch("Song")
		Datos.Y = Datos.Y + Datos.Fuerza*NewAudio.GetPitch("Song")
		Datos.Fuerza = Datos.Fuerza - Datos.Gravedad*NewAudio.GetPitch("Song")
		Datos.Bullet.sprite.rotation = Datos.Bullet.sprite.rotation + Datos.VelRot*NewAudio.GetPitch("Song")
		Datos.Bullet.MoveToAbs(Datos.X, Datos.Y)
		if Datos.X <= Datos.Remove.Left or Datos.X >= Datos.Remove.Right or Datos.Y <= Datos.Remove.Down then
			Datos.Bullet.Remove()
			table.remove(Caida, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#GeneraMontes do
		local Datos = GeneraMontes[i - tableaux]
		while SongTime >= Datos.SpawnTime do
			local Cabeza = CreateProjectileAbs("JS&B Library Sprites/Circle", 0, 0)
			local Cuerpo = CreateProjectileAbs("Pixel", 0, 0)
			Cabeza.SetVar("NoDamage", 1)
			Cuerpo.SetVar("NoDamage", 1)
			Cabeza.sprite.Scale(60/480, 60/480)
			Cuerpo.sprite.Scale(60, 0)
			if Datos.Direction%2 == 0 then
				table.insert(Montes, {Bullet = {Head = Cabeza, Body = Cuerpo}, Y = Datos.Y, Appear = Datos.SpawnTime, Stay = Datos.Stay, Lenght = Datos.Lenght, Direction = Datos.Direction})
				Datos.Y = Datos.Y + 60*Datos.Sentido
			else
				table.insert(Montes, {Bullet = {Head = Cabeza, Body = Cuerpo}, X = Datos.X, Appear = Datos.SpawnTime, Stay = Datos.Stay, Lenght = Datos.Lenght, Direction = Datos.Direction})
				Datos.X = Datos.X + 60*Datos.Sentido
			end
			Datos.Lenght = Datos.Lenght + Datos.Increment
			Datos.SpawnTime = Datos.SpawnTime + Datos.Speed
		end
		if (Datos.Direction%2 == 1 and (Datos.X >= 670 or Datos.X <= -30)) or (Datos.Direction%2 == 0 and (Datos.Y >= 510 or Datos.Y <= -30)) then
			table.remove(GeneraMontes, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Montes do
		local Datos = Montes[i - tableaux]
		Datos.Bullet.Head.SetVar("NoDamage", Datos.Bullet.Head.GetVar("NoDamage") - 1)
		Datos.Bullet.Body.SetVar("NoDamage", Datos.Bullet.Body.GetVar("NoDamage") - 1)
		if SongTime < Datos.Appear then
			Datos.Bullet.Head.Remove()
			Datos.Bullet.Body.Remove()
			table.remove(Montes, i - tableaux)
			tableaux = tableaux + 1
		elseif SongTime <= Datos.Appear + 0.1 then
			Datos.Bullet.Body.sprite.yscale = Datos.Lenght*math.sin(math.rad(90/0.1*(SongTime - Datos.Appear)))
			Datos.Bullet.Head.sprite.color = {1, (88 - 56*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255, (148 - 36*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255}
			Datos.Bullet.Body.sprite.color = {1, (88 - 56*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255, (148 - 36*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255}
		elseif SongTime <= Datos.Appear + Datos.Stay + 0.1 then
			Datos.Bullet.Body.sprite.yscale = Datos.Lenght
			Datos.Bullet.Head.sprite.color = {1, 32/255, 112/255}
			Datos.Bullet.Body.sprite.color = {1, 32/255, 112/255}
		elseif SongTime <= Datos.Appear + Datos.Stay + 0.2 then
			Datos.Bullet.Body.sprite.yscale = Datos.Lenght*math.cos(math.rad(90/0.1*(SongTime - (Datos.Appear + Datos.Stay + 0.1))))
			Datos.Bullet.Head.sprite.color = {1, 32/255, 112/255}
			Datos.Bullet.Body.sprite.color = {1, 32/255, 112/255}
		elseif SongTime > Datos.Appear + Datos.Stay + 0.2 then
			Datos.Bullet.Head.Remove()
			Datos.Bullet.Body.Remove()
			table.remove(Montes, i - tableaux)
			tableaux = tableaux + 1
		end
		if Datos.Bullet.Head.isactive then
			if Datos.Direction%2 == 0 then
				Datos.Bullet.Body.sprite.rotation = 90
				Datos.Bullet.Body.MoveToAbs(-30 + 700*math.cos(math.rad(45*Datos.Direction)) - Datos.Bullet.Body.sprite.yscale*math.cos(math.rad(90*Datos.Direction))/2, Datos.Y)
				Datos.Bullet.Head.MoveToAbs(-30 + 700*math.cos(math.rad(45*Datos.Direction)) - Datos.Bullet.Body.sprite.yscale*math.cos(math.rad(90*Datos.Direction)), Datos.Y)
			else
				Datos.Bullet.Body.MoveToAbs(Datos.X, -30 + 540*math.sin(math.rad(45*Datos.Direction + 45)) - Datos.Bullet.Body.sprite.yscale*math.sin(math.rad(90*Datos.Direction))/2)
				Datos.Bullet.Head.MoveToAbs(Datos.X, -30 + 540*math.sin(math.rad(45*Datos.Direction + 45)) - Datos.Bullet.Body.sprite.yscale*math.sin(math.rad(90*Datos.Direction)))
			end
		end
	end
	tableaux = 0
	for i=1,#Generator do
		local Datos = Generator[i - tableaux]
		if not Datos.Saws then
			Datos.Saws = {}
		end
		if not Datos.Timer then
			Datos.Timer = 0
		end
		Datos.Timer = Datos.Timer + NewAudio.GetPitch("Song")
		Datos.Trail.Scale(1200, 6)
		Datos.Trail.rotation = Datos.Direction
		if Datos.Timer >= 1 then
			local Misil = CreateProjectileAbs(Datos.Spawner.Sprite, Datos.PX + Datos.Spawner.X, Datos.PY + Datos.Spawner.Y)
			Misil.SetVar("NoDamage", 1)
			Misil.sprite.color = {1, 32/255, 112/255}
			Misil.sprite.Scale(Datos.Spawner.Scale, Datos.Spawner.Scale)
			table.insert(Datos.Saws, {Bullet = Misil, PX = Datos.Spawner.X, PY = Datos.Spawner.Y, VelRot = Datos.Spawner.Rot, Vel = Datos.Spawner.Vel, Right = Datos.Spawner.Eliminate.Right, Left = Datos.Spawner.Eliminate.Left, Up = Datos.Spawner.Eliminate.Up, Down = Datos.Spawner.Eliminate.Down})
			Datos.Timer = Datos.Timer - Datos.Rate
		end
		Datos.Trail.MoveTo(Datos.PX + (Datos.Distancia/(Datos.Eliminate - Datos.Appear)*(SongTime - Datos.Appear))*math.cos(math.rad(Datos.Movement)), Datos.PY + (Datos.Distancia/(Datos.Eliminate - Datos.Appear)*(SongTime - Datos.Appear))*math.sin(math.rad(Datos.Movement)))
		local tableaux2 = 0
		for j=1,#Datos.Saws do
			local Misil = Datos.Saws[j - tableaux2]
			Misil.Bullet.SetVar("NoDamage", Misil.Bullet.GetVar("NoDamage") - 1)
			Misil.PX = Misil.PX + Misil.Vel*math.cos(math.rad(Datos.Direction))*NewAudio.GetPitch("Song")
			Misil.PY = Misil.PY + Misil.Vel*math.sin(math.rad(Datos.Direction))*NewAudio.GetPitch("Song")
			Misil.Bullet.MoveToAbs(Datos.PX + (Datos.Distancia/(Datos.Eliminate - Datos.Appear)*(SongTime - Datos.Appear))*math.cos(math.rad(Datos.Movement)) + Misil.PX, Datos.PY + (Datos.Distancia/(Datos.Eliminate - Datos.Appear)*math.max(SongTime - Datos.Appear, 0))*math.sin(math.rad(Datos.Movement)) + Misil.PY)
			Misil.Bullet.sprite.rotation = Misil.Bullet.sprite.rotation + Misil.VelRot*NewAudio.GetPitch("Song")
			if Misil.Bullet.absx > (Misil.Right or 645) or Misil.Bullet.absx < (Misil.Left or -5) or Misil.Bullet.absy > (Misil.Up or 485) or Misil.Bullet.absy < (Misil.Down or -5) then
				Misil.Bullet.Remove()
				table.remove(Datos.Saws, j - tableaux2)
				tableaux2 = tableaux2 + 1
			end
		end
		if SongTime < Datos.Appear or SongTime > Datos.Eliminate then
			local tableaux2 = 0
			for j=1,#Datos.Saws do
				Datos.Saws[j - tableaux2].Bullet.Remove()
				table.remove(Datos.Saws, j - tableaux2)
				tableaux2 = tableaux2 + 1
			end
			Datos.Trail.Remove()
			table.remove(Generator, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Circles do
		local Datos = Circles[i - tableaux]
		if not Datos.Warn then
			Datos.Warn = CreateSprite("JS&B Library Sprites/CircleSpawn","BelowPlayer")
			Datos.Warn.color = {1, 32/255, 112/255}
		end
		if not Datos.Bullet then
			Datos.Bullet = CreateProjectileAbs("JS&B Library Sprites/Circle", 0, 0)
		end
		if Scroll and not Datos.Absoluto then
			Datos.X = Datos.X + Scroll.X*NewAudio.GetPitch("Song")
			Datos.Y = Datos.Y + Scroll.Y*NewAudio.GetPitch("Song")
		end
		Datos.Warn.MoveTo(Datos.X, Datos.Y)
		Datos.Bullet.MoveToAbs(Datos.X, Datos.Y)
		Datos.Warn.Scale(Datos.Scale.Standard/480, Datos.Scale.Standard/480)
		Datos.Warn.rotation = Datos.Warn.rotation + 1
		Datos.Bullet.sprite.color = {1, (143.5 - 111.5*math.cos(math.rad(180/0.1*SongTime)))/255, (183.5 - 71.5*math.cos(math.rad(180/0.1*SongTime)))/255}
		if SongTime < Datos.Inicial then
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Circles, i - tableaux)
			tableaux = tableaux + 1
		elseif SongTime <= Datos.Appear then
			Datos.Warn.alpha = 1
			Datos.Bullet.sprite.Scale(0, 0)
			Datos.Bullet.SetVar("NoDamage", 1)
		elseif SongTime <= Datos.Appear + Datos.SpawnTime then
			Datos.Warn.alpha = 1
			local randomizador = math.random(0, 10)
			Datos.Bullet.sprite.Scale(((Datos.Scale.Standard + randomizador)*math.sin(math.rad(90/Datos.SpawnTime*(SongTime - Datos.Appear))))/480, ((Datos.Scale.Standard + randomizador)*math.sin(math.rad(90/Datos.SpawnTime*(SongTime - Datos.Appear))))/480)
			Datos.Bullet.SetVar("NoDamage", nil)
		elseif SongTime <= Datos.Appear + Datos.SpawnTime + Datos.Stay then
			Datos.Warn.alpha = 0
			local randomizador = math.random(0, 10)
			Datos.Bullet.sprite.Scale((Datos.Scale.Standard + Datos.Scale.Increment/Datos.Stay*(SongTime - (Datos.Appear + Datos.SpawnTime)) + randomizador)/480, (Datos.Scale.Standard + Datos.Scale.Increment/Datos.Stay*(SongTime - (Datos.Appear + Datos.SpawnTime)) + randomizador)/480)
			Datos.Bullet.SetVar("NoDamage", nil)
		elseif SongTime <= Datos.Appear + Datos.SpawnTime + Datos.Stay + 0.1 then
			Datos.Warn.alpha = 0
			local randomizador = math.random(0, 10)
			Datos.Bullet.sprite.Scale(((Datos.Scale.Standard + Datos.Scale.Increment + randomizador)*math.cos(math.rad(90/0.1*(SongTime - (Datos.Appear + Datos.SpawnTime + Datos.Stay)))))/480, ((Datos.Scale.Standard + Datos.Scale.Increment + randomizador)*math.cos(math.rad(90/0.1*(SongTime - (Datos.Appear + Datos.SpawnTime + Datos.Stay)))))/480)
			Datos.Bullet.SetVar("NoDamage", nil)
		else
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Circles, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Barras3 do
		local Datos = Barras3[i - tableaux]
		Datos.Ang = Datos.Ang + Datos.Vel*NewAudio.GetPitch("Song")
		Datos.Warn.rotation = Datos.Ang
		Datos.Bullet.sprite.rotation = Datos.Ang
		if not Datos.NoColor then
			Datos.Bullet.sprite.color = {1, 32/255, 112/255}
		end
		if Scroll and not Datos.Absoluto then
			Datos.PX = Datos.PX + Scroll.X*NewAudio.GetPitch("Song")
			Datos.PY = Datos.PY + Scroll.Y*NewAudio.GetPitch("Song")
		end
		if SongTime < Datos.Inicial then
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Barras3, i - tableaux)
			tableaux = tableaux + 1
		elseif SongTime <= Datos.Appear then
			Datos.Bullet.sprite.Scale(0, 0)
			Datos.Warn.Scale(Datos.Lenght.Current + Datos.Lenght.Increment/(Datos.Appear - Datos.Inicial)*(SongTime - Datos.Inicial), Datos.Grosor)
			Datos.Warn.alpha = 0.1 + 0.1*math.sin(math.rad(90/0.1*SongTime)) + 0.3/(Datos.Appear - Datos.Inicial)*(SongTime - Datos.Inicial)
		elseif SongTime <= Datos.Appear + 0.1 then
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Bullet.sprite.Scale((Datos.Lenght.Current + Datos.Lenght.Increment) + (900 - (Datos.Lenght.Current + Datos.Lenght.Increment))/0.1*(SongTime - Datos.Appear), Datos.Grosor)
			if not Datos.NoColor then
				Datos.Bullet.sprite.color = {1, (143.5 + 111.5*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255, (183.5 + 71.5*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255}
			end
			Datos.Warn.Scale(Datos.Lenght.Current + Datos.Lenght.Increment, Datos.Grosor)
			Datos.Warn.alpha = 0.1 + 0.1*math.sin(math.rad(90/0.1*SongTime)) + 0.3/(Datos.Appear - Datos.Inicial)*(SongTime - Datos.Inicial)
		elseif SongTime <= Datos.Disappear then
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Warn.alpha = 0
			Datos.Bullet.sprite.Scale(900, Datos.Grosor)
		elseif SongTime <= Datos.Disappear + 0.1 then
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Bullet.sprite.Scale(900 - 900/0.1*(SongTime - Datos.Disappear), Datos.Grosor)
		elseif SongTime > Datos.Disappear + 0.1 then
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Barras3, i - tableaux)
			tableaux = tableaux + 1
		end
		if Datos.Bullet.isactive then
			Datos.Warn.MoveTo(Datos.PX + Datos.Warn.xscale/2*math.cos(math.rad(Datos.Ang)), Datos.PY + Datos.Warn.xscale/2*math.sin(math.rad(Datos.Ang)))
			Datos.Bullet.MoveToAbs(Datos.PX + Datos.Bullet.sprite.xscale/2*math.cos(math.rad(Datos.Ang)), Datos.PY + Datos.Bullet.sprite.xscale/2*math.sin(math.rad(Datos.Ang)))
		end
	end
	tableaux = 0
	for i=1,#Barras2 do
		local Datos = Barras2[i - tableaux]
		Datos.Warn.rotation = Datos.Ang
		Datos.Bullet.sprite.rotation = Datos.Ang
		if Scroll and not Datos.Absoluto then
			Datos.PX = Datos.PX + Scroll.X*NewAudio.GetPitch("Song")
			Datos.PY = Datos.PY + Scroll.Y*NewAudio.GetPitch("Song")
		end
		Datos.Warn.MoveTo(Datos.PX + 450*math.cos(math.rad(Datos.Ang)), Datos.PY + 450*math.sin(math.rad(Datos.Ang)))
		Datos.Bullet.MoveToAbs(Datos.PX + 450*math.cos(math.rad(Datos.Ang)), Datos.PY + 450*math.sin(math.rad(Datos.Ang)))
		if not Datos.NoColor then
			Datos.Bullet.sprite.color = {1, 32/255, 112/255}
		end
		if SongTime < Datos.Inicial then
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Barras2, i - tableaux)
			tableaux = tableaux + 1
		elseif SongTime <= Datos.Appear then
			Datos.Bullet.sprite.Scale(0, 0)
			Datos.Warn.Scale(900, Datos.Grosor)
			Datos.Warn.alpha = (0.4 + 0.1*math.sin(math.rad(90/0.1*SongTime)))/(Datos.Appear - Datos.Inicial)*(SongTime - Datos.Inicial)
		elseif SongTime <= Datos.Appear + 0.1 then
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Bullet.sprite.Scale(900, Datos.Grosor*math.sin(math.rad(90/0.1*(SongTime - Datos.Appear))))
			if not Datos.NoColor then
				Datos.Bullet.sprite.color = {1, (143.5 + 111.5*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255, (183.5 + 71.5*math.cos(math.rad(180/0.1*(SongTime - Datos.Appear))))/255}
			end
			Datos.Warn.Scale(900, Datos.Grosor)
			Datos.Warn.alpha = (0.4 + 0.1*math.sin(math.rad(90/0.1*SongTime)))/(Datos.Appear - Datos.Inicial)*(SongTime - Datos.Inicial)
		elseif SongTime <= Datos.Disappear then
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Warn.alpha = 0
			Datos.Bullet.sprite.Scale(900, Datos.Grosor)
		elseif SongTime <= Datos.Disappear + 0.1 then
			Datos.Bullet.SetVar("NoDamage", nil)
			Datos.Bullet.sprite.Scale(900, Datos.Grosor*math.cos(math.rad(90/0.1*(SongTime - Datos.Disappear))))
		elseif SongTime > Datos.Disappear + 0.1 then
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Barras2, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Barras do
		local Datos = Barras[i - tableaux]
		if SongTime <= Datos.Appear - 0.1 then
			Datos.Bullet.SetVar("NoDamage", 1)
			if Datos.Direction%2 == 0 then
				Datos.Bullet.sprite.Scale(40/((Datos.Appear - 0.1) - Datos.Inicial)*(SongTime - Datos.Inicial), Datos.Grosor)
				Datos.Warn.Scale(640, Datos.Grosor)
			else
				Datos.Bullet.sprite.Scale(Datos.Grosor, 40/((Datos.Appear - 0.1) - Datos.Inicial)*(SongTime - Datos.Inicial))
				Datos.Warn.Scale(Datos.Grosor, 480)
			end
			Datos.Warn.alpha = (0.4 + 0.1*math.sin(math.rad(90/0.1*SongTime)))/((Datos.Appear - 0.1) - Datos.Inicial)*(SongTime - Datos.Inicial)
			Datos.Bullet.sprite.color = {1, 32/255, 112/255}
		elseif SongTime <= Datos.Appear then
			Datos.Bullet.SetVar("NoDamage", nil)
			if not Datos.Warn then
				Datos.Warn = CreateSprite("Pixel","BelowPlayer")
				Datos.Warn.color = {1, 32/255, 112/255}
			end
			if Datos.Direction%2 == 0 then
				Datos.Bullet.sprite.Scale(40 + 600/0.1*(SongTime - (Datos.Appear - 0.1)), Datos.Grosor)
				Datos.Warn.Scale(640, Datos.Grosor)
			else
				Datos.Bullet.sprite.Scale(Datos.Grosor, 40 + 440/0.1*(SongTime - (Datos.Appear - 0.1)))
				Datos.Warn.Scale(Datos.Grosor, 480)
			end
			Datos.Warn.alpha = (0.4 + 0.1*math.sin(math.rad(90/0.1*SongTime)))/((Datos.Appear - 0.1) - Datos.Inicial)*(SongTime - Datos.Inicial)
			Datos.Bullet.sprite.color = {1, (143.5 + 111.5*math.cos(math.rad(180/0.1*(SongTime - (Datos.Appear - 0.1)))))/255, (183.5 + 71.5*math.cos(math.rad(180/0.1*(SongTime - (Datos.Appear - 0.1)))))/255}
		elseif SongTime > Datos.Disappear then
			Datos.Bullet.SetVar("NoDamage", nil)
			if Datos.Direction%2 == 0 then
				Datos.Bullet.sprite.Scale(640 - 640/0.1*(SongTime - Datos.Disappear), Datos.Grosor)
			else
				Datos.Bullet.sprite.Scale(Datos.Grosor, 480 - 480/0.1*(SongTime - Datos.Disappear))
			end
		elseif SongTime > Datos.Appear then
			Datos.Bullet.SetVar("NoDamage", nil)
			if Datos.Direction%2 == 0 then
				Datos.Bullet.sprite.Scale(640, Datos.Grosor)
				if Datos.Warn then
					Datos.Warn.Scale(640, Datos.Grosor)
				end
			else
				Datos.Bullet.sprite.Scale(Datos.Grosor, 480)
				if Datos.Warn then
					Datos.Warn.Scale(Datos.Grosor, 480)
				end
			end
		end
		if Datos.Warn then
			if Datos.Direction%2 == 0 then
				Datos.Warn.MoveTo(320, Datos.PY)
			else
				Datos.Warn.MoveTo(Datos.PX, 240)
			end
		end
		if Datos.Direction%2 == 0 then
			if Scroll and not Datos.Absoluto then
				Datos.PY = Datos.PY + Scroll.Y*NewAudio.GetPitch("Song")
			end
			Datos.Bullet.MoveToAbs(320 - (320 - Datos.Bullet.sprite.xscale/2)*math.cos(math.rad(90*Datos.Direction)), Datos.PY)
		else
			if Scroll and not Datos.Absoluto then
				Datos.PX = Datos.PX + Scroll.X*NewAudio.GetPitch("Song")
			end
			Datos.Bullet.MoveToAbs(Datos.PX, 240 - (240 - Datos.Bullet.sprite.yscale/2)*math.sin(math.rad(90*Datos.Direction)))
		end
		if (SongTime > Datos.Appear and not backwards) or SongTime < Datos.Inicial then
			if Datos.Warn then
				Datos.Warn.Remove()
				Datos.Warn = nil
				if not Datos.Shake then
					if not rango or rango <= Datos.Intensidad then
						if Datos.Direction%4 == 1 then
							movement = {0, "Up"}
						elseif Datos.Direction%4 == 2 then
							movement = {0, "Left"}
						elseif Datos.Direction%4 == 3 then
							movement = {0, "Down"}
						else
							movement = {0, "Right"}
						end
						rango = Datos.Intensidad
					end
				else
					if not rango or rango <= Datos.Intensidad then
						shakescreen = 0
						rango = Datos.Intensidad
					end
				end
			end
			Datos.Bullet.sprite.color = {1, 32/255, 112/255}
		end
		if SongTime > Datos.Disappear + 0.1 or SongTime < Datos.Inicial then
			if Datos.Warn then
				Datos.Warn.Remove()
			end
			Datos.Bullet.Remove()
			table.remove(Barras, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Explotions do
		local Datos = Explotions[i - tableaux]
		if not Datos.Explosives then
			Datos.Explosives = {}
		end
		if not Datos.Ondulacion then
			Datos.Ondulacion = 0
		end
		if not Datos.Bullet.GetVar("NoDamage") then
			Datos.Bullet.SetVar("NoDamage", 1)
		end
		Datos.Bullet.SetVar("NoDamage", Datos.Bullet.GetVar("NoDamage") - 1)
		if Scroll then
			Datos.PX = Datos.PX + Scroll.X*NewAudio.GetPitch("Song")
			Datos.PY = Datos.PY + Scroll.Y*NewAudio.GetPitch("Song")
		end
		if Datos.Bullet.isactive then
			if SongTime <= Datos.Eliminate - Datos.Stay/60 then
				Datos.Bullet.MoveToAbs(Datos.PX + Datos.X*math.sin(math.rad(90/((Datos.Eliminate - Datos.Appear) - Datos.Stay/60)*(SongTime - Datos.Appear))), Datos.PY + Datos.Y*math.sin(math.rad(90/((Datos.Eliminate - Datos.Appear) - Datos.Stay/60)*(SongTime - Datos.Appear))))
			else
				Datos.Bullet.MoveToAbs(Datos.PX + Datos.X, Datos.PY + Datos.Y)
			end
			Datos.Bullet.sprite.Scale((Datos.ScaleLimit/(Datos.Eliminate - Datos.Appear)*(SongTime - Datos.Appear))/480, (Datos.ScaleLimit/(Datos.Eliminate - Datos.Appear)*(SongTime - Datos.Appear))/480)
			Datos.Bullet.sprite.rotation = Datos.Bullet.sprite.rotation + Datos.VelRot/(Datos.Eliminate - Datos.Appear - Datos.Stay/60)*math.min(SongTime - Datos.Appear, (Datos.Eliminate - Datos.Appear - Datos.Stay/60))*NewAudio.GetPitch("Song")
			if SongTime >= Datos.Eliminate - Datos.Stay/60 then
				Datos.Bullet.sprite.color = {1, (143.5 - 111.5*math.cos(math.rad(360/0.1*((SongTime - Datos.Appear) - ((Datos.Eliminate - Datos.Appear) - Datos.Stay/60)/2))))/255, (183.5 - 71.5*math.cos(math.rad(360/0.1*((SongTime - Datos.Appear) - ((Datos.Eliminate - Datos.Appear) - Datos.Stay/60)/2))))/255}
			else
				Datos.Bullet.sprite.color = {1, 32/255, 112/255}
			end
			if SongTime >= Datos.Eliminate or SongTime < Datos.Appear then
				if not backwards or (backwards and #Datos.Explosives > 0) then
					if not backwards and not Datos.NoCegar then
						cegar = 0
					end
					local Pang = math.random(360)
					for i=1,Datos.Misiles do
						local Bullet = CreateProjectileAbs("JS&B Library Sprites/Circle", Datos.Bullet.absx, Datos.Bullet.absy)
						Bullet.SetVar("NoDamage", 1)
						Bullet.ppcollision = false
						Bullet.sprite.color = {1, 32/255, 112/255}
						Bullet.sprite.Scale(10/480, 10/480)
						table.insert(Datos.Explosives, {Bullet = Bullet, VelRot = 3, Vel = (Datos.Vel or 6), Eliminate = Datos.Eliminate + (Datos.Time or 3), Ang = Pang + 360/Datos.Misiles*i})
					end
					Datos.Bullet.Remove()
				else
					Datos.Bullet.Remove()
					table.remove(Explotions, i - tableaux)
					tableaux = tableaux + 1
				end
			end
		else
			Datos.Ondulacion = Datos.Ondulacion - 18*NewAudio.GetPitch("Song")
			local tableaux2 = 0
			for j=1,#Datos.Explosives do
				local Misil = Datos.Explosives[j - tableaux2]
				Misil.Bullet.SetVar("NoDamage", Misil.Bullet.GetVar("NoDamage") - 1)
				Misil.Bullet.MoveToAbs(Datos.PX + Datos.X + Misil.Vel/(1/60)*(SongTime - Datos.Eliminate)*math.cos(math.rad(Misil.Ang)) + 4*math.cos(math.rad(Datos.Ondulacion + Misil.Ang)), Datos.PY + Datos.Y + Misil.Vel/(1/60)*(SongTime - Datos.Eliminate)*math.sin(math.rad(Misil.Ang)) + 4*math.sin(math.rad(Datos.Ondulacion + Misil.Ang)))
				Misil.Bullet.sprite.rotation = Misil.Bullet.sprite.rotation + Misil.VelRot*NewAudio.GetPitch("Song")
				if SongTime > Misil.Eliminate or SongTime < Datos.Eliminate or (Datos.NoLag and (Misil.Bullet.absx < -20 or Misil.Bullet.absx > 660 or Misil.Bullet.absy < -20 or Misil.Bullet.absy > 500)) then
					Misil.Bullet.Remove()
					table.remove(Datos.Explosives, j - tableaux2)
					tableaux2 = tableaux2 + 1
				end
			end
			if #Datos.Explosives <= 0 then
				if not backwards then
					table.remove(Explotions, i - tableaux)
					tableaux = tableaux + 1
				else
					Datos.Bullet = CreateProjectileAbs("JS&B Library Sprites/Explosive", 660, 0)
					Datos.Bullet.sprite.Scale(Datos.ScaleLimit/480, Datos.ScaleLimit/480)
					Datos.Bullet.sprite.color = {1, 32/255, 112/255}
					Datos.Bullet.SetVar("NoDamage", 1)
					if not Datos.NoCegar then
						cegar = 0
					end
				end
			end
		end
	end
	tableaux = 0
	for i=1,#Bullets do
		if Scroll and not Bullets[i - tableaux].GetVar("Absoluto") then
			Bullets[i - tableaux].SetVar("X", Bullets[i - tableaux].GetVar("X") + Scroll.X*NewAudio.GetPitch("Song"))
			Bullets[i - tableaux].SetVar("Y", Bullets[i - tableaux].GetVar("Y") + Scroll.Y*NewAudio.GetPitch("Song"))
		end
		Bullets[i - tableaux].SetVar("NoDamage", Bullets[i - tableaux].GetVar("NoDamage") - 1)
		Bullets[i - tableaux].MoveToAbs(Bullets[i - tableaux].GetVar("X"), Bullets[i - tableaux].GetVar("Y"))
		Bullets[i - tableaux].sprite.rotation = Bullets[i - tableaux].sprite.rotation + Bullets[i - tableaux].GetVar("SpeedRot")*NewAudio.GetPitch("Song")
		if Bullets[i - tableaux].GetVar("Remove") then
			Bullets[i - tableaux].Remove()
			table.remove(Bullets, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Movement do
		local Datos = Movement[i - tableaux]
		if not Datos.Bullet.GetVar("NoDamage") then
			Datos.Bullet.SetVar("NoDamage", 1)
		end
		if Datos.Scale.Time < 1 then
			Datos.Scale.Time = 1
		end
		if not Datos.Ondulacion then
			Datos.Ondulacion = {Radio = 0, Time = 1, Angle = 0}
		end
		if Scroll and not Datos.Absoluto then
			Datos.X = Datos.X + Scroll.X*NewAudio.GetPitch("Song")
			Datos.Y = Datos.Y + Scroll.Y*NewAudio.GetPitch("Song")
		end
		Datos.Bullet.SetVar("NoDamage", Datos.Bullet.GetVar("NoDamage") - 1)
		Datos.X2 = Datos.X + Datos.Vel*60*math.cos(math.rad(Datos.Direction))*(SongTime - Datos.SpawnTime) + Datos.Ondulacion.Radio*math.cos(math.rad(360/Datos.Ondulacion.Time*(SongTime - Datos.SpawnTime) + Datos.Ondulacion.Angle))
		Datos.Y2 = Datos.Y + Datos.Vel*60*math.sin(math.rad(Datos.Direction))*(SongTime - Datos.SpawnTime) + Datos.Ondulacion.Radio*math.sin(math.rad(360/Datos.Ondulacion.Time*(SongTime - Datos.SpawnTime) + Datos.Ondulacion.Angle))
		Datos.Bullet.MoveToAbs(Datos.X2, Datos.Y2)
		Datos.Bullet.sprite.rotation = Datos.Bullet.sprite.rotation + (Datos.VelRot or 0)*NewAudio.GetPitch("Song")
		Datos.Bullet.sprite.Scale(Datos.Scale.Initial + Datos.Scale.Increment/Datos.Scale.Time*math.min((SongTime - Datos.SpawnTime)*60, Datos.Scale.Time), Datos.Scale.Initial + Datos.Scale.Increment/Datos.Scale.Time*math.min((SongTime - Datos.SpawnTime)*60, Datos.Scale.Time))
		if SongTime < Datos.SpawnTime or SongTime > Datos.SpawnTime + (Datos.LifeTime or 5) or (Datos.NoLag and (Datos.X2 >= (Datos.Right or 700) or Datos.X2 <= (Datos.Left or -60) or Datos.Y2 >= (Datos.Up or 540) or Datos.Y2 <= (Datos.Down or -60))) then
			Datos.Bullet.Remove()
			table.remove(Movement, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Fall do
		local Datos = Fall[i - tableaux]
		if not Datos.PYIni then
			Datos.PYIni = Datos.PY
		end
		Datos.PY = Datos.PY + Datos.Vel*NewAudio.GetPitch("Song")
		if Scroll then
			Datos.PX = Datos.PX + Scroll.X*NewAudio.GetPitch("Song")
			Datos.PY = Datos.PY + Scroll.Y*NewAudio.GetPitch("Song")
		end
		if NewAudio.GetPitch("Song") >= 1 then
			Datos.Vel = Datos.Vel*1.02
		elseif NewAudio.GetPitch("Song") <= -1 then
			Datos.Vel = Datos.Vel/1.02
		end
		Datos.Bullet.sprite.rotation = Datos.Bullet.sprite.rotation + Datos.VelRot*NewAudio.GetPitch("Song")
		Datos.Bullet.MoveToAbs(Datos.PX, Datos.PY)
		if Datos.PY <= -20 or Datos.PY > Datos.PYIni then
			Datos.Bullet.Remove()
			table.remove(Fall, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	for i=1,#Snake do
		local Datos = Snake[i - tableaux]
		if not Datos.Timer then
			Datos.Timer = 0
		end
		if math.abs(NewAudio.GetPitch("Song")) >= 1 then
			Datos.Timer = math.floor(Datos.Timer + 1)
		elseif math.abs(NewAudio.GetPitch("Song")) >= 0.5 then
			Datos.Timer = Datos.Timer + 0.5
		elseif math.abs(NewAudio.GetPitch("Song")) >= 0.25 then
			Datos.Timer = Datos.Timer + 0.25
		elseif math.abs(NewAudio.GetPitch("Song")) >= 0.125 then
			Datos.Timer = Datos.Timer + 0.125
		end
		if not Datos.NoAnim then
			Datos.Bullets[1].sprite.color = {1,(32 + 223*math.cos(math.rad(90/Datos.Rateo*(Datos.Timer%Datos.Rateo))))/255,(112 + 143*math.cos(math.rad(90/Datos.Rateo*(Datos.Timer%Datos.Rateo))))/255}
			Datos.Bullets[1].sprite.Scale(Datos.Scale + Datos.Pulse*math.cos(math.rad(90/Datos.Rateo*(Datos.Timer%Datos.Rateo))), Datos.Scale + Datos.Pulse*math.cos(math.rad(90/Datos.Rateo*(Datos.Timer%Datos.Rateo))))
			Datos.Bullets[#Datos.Bullets].sprite.Scale(Datos.Scale*math.cos(math.rad(90/Datos.Rateo*(Datos.Timer%Datos.Rateo))), Datos.Scale*math.cos(math.rad(90/Datos.Rateo*(Datos.Timer%Datos.Rateo))))
		end
		if Scroll then
			Datos.X = Datos.X + Scroll.X*NewAudio.GetPitch("Song")
			Datos.Y = Datos.Y + Scroll.Y*NewAudio.GetPitch("Song")
		end
		if Datos.Timer%Datos.Rateo == 0 then
			if not backwards then
				for j=1,#Datos.Bullets do
					Datos.Bullets[j].SetVar("Ang", Datos.Bullets[j].GetVar("Ang") - Datos.Bullets[j].GetVar("Incremento"))
				end
				if Datos.Direction%2 == 0 then
					Datos.X = Datos.X - (Datos.Espaciado - (Datos.Retroceder or 0))*((Datos.Direction%4*2 - 2)/2)
				else
					Datos.Y = Datos.Y - (Datos.Espaciado - (Datos.Retroceder or 0))*(((Datos.Direction - 1)%4*2 - 2)/2)
				end
			else
				for j=1,#Datos.Bullets do
					Datos.Bullets[j].SetVar("Ang", Datos.Bullets[j].GetVar("Ang") + Datos.Bullets[j].GetVar("Incremento"))
				end
				if Datos.Direction%2 == 0 then
					Datos.X = Datos.X + (Datos.Espaciado - (Datos.Retroceder or 0))*((Datos.Direction%4*2 - 2)/2)
				else
					Datos.Y = Datos.Y + (Datos.Espaciado - (Datos.Retroceder or 0))*(((Datos.Direction - 1)%4*2 - 2)/2)
				end
			end
		end
		for j=1,#Datos.Bullets do
			if not Datos.Bullets[j].GetVar("NoDamage") then
				Datos.Bullets[j].SetVar("NoDamage", 1)
			else
				Datos.Bullets[j].SetVar("NoDamage", Datos.Bullets[j].GetVar("NoDamage") - 1)
			end
			Datos.Bullets[j].SetVar("Ang", Datos.Bullets[j].GetVar("Ang") - Datos.Vel*NewAudio.GetPitch("Song"))
			if Datos.Bullets[j].GetVar("Rot") then
				Datos.Bullets[j].sprite.rotation = Datos.Bullets[j].sprite.rotation + Datos.Bullets[j].GetVar("Rot")*NewAudio.GetPitch("Song") 
			end
			if j ~= 1 and j ~= #Datos.Bullets and not Datos.NoAnim then
				Datos.Bullets[j].sprite.Scale(Datos.Scale, Datos.Scale)
			elseif Datos.NoAnim then
				Datos.Bullets[j].sprite.Scale(Datos.Scale, Datos.Scale)
			end
			if Datos.Direction%2 == 0 then
				Datos.Bullets[j].MoveToAbs(Datos.X + Datos.Espaciado*(j - 1)*((Datos.Direction%4*2 - 2)/2), Datos.Y + Datos.Height*math.sin(math.rad(Datos.Bullets[j].GetVar("Ang"))))
			else
				Datos.Bullets[j].MoveToAbs(Datos.X + Datos.Height*math.sin(math.rad(Datos.Bullets[j].GetVar("Ang"))), Datos.Y + Datos.Espaciado*(j - 1)*(((Datos.Direction - 1)%4*2 - 2)/2))
			end
			if Datos.Hide then
				if Datos.Direction == 0 then
					if Datos.X + Datos.Espaciado*(j - 1)*((Datos.Direction%4*2 - 2)/2) < Datos.Hide.X then
						Datos.Bullets[j].sprite.alpha = 0
						Datos.Bullets[j].SetVar("NoDamage", 1)
					else
						Datos.Bullets[j].sprite.alpha = 1
						Datos.Bullets[j].SetVar("NoDamage", nil)
					end
				elseif Datos.Direction == 1 then
					if Datos.Y + Datos.Espaciado*(j - 1)*(((Datos.Direction - 1)%4*2 - 2)/2) < Datos.Hide.Y then
						Datos.Bullets[j].sprite.alpha = 0
						Datos.Bullets[j].SetVar("NoDamage", 1)
					else
						Datos.Bullets[j].sprite.alpha = 1
						Datos.Bullets[j].SetVar("NoDamage", nil)
					end
				elseif Datos.Direction == 2 then
					if Datos.X + Datos.Espaciado*(j - 1)*((Datos.Direction%4*2 - 2)/2) > Datos.Hide.X then
						Datos.Bullets[j].sprite.alpha = 0
						Datos.Bullets[j].SetVar("NoDamage", 1)
					else
						Datos.Bullets[j].sprite.alpha = 1
						Datos.Bullets[j].SetVar("NoDamage", nil)
					end
				else
					if Datos.Y + Datos.Espaciado*(j - 1)*(((Datos.Direction - 1)%4*2 - 2)/2) > Datos.Hide.Y then
						Datos.Bullets[j].sprite.alpha = 0
						Datos.Bullets[j].SetVar("NoDamage", 1)
					else
						Datos.Bullets[j].sprite.alpha = 1
						Datos.Bullets[j].SetVar("NoDamage", nil)
					end
				end
			end
		end
		if Datos.X > Datos.Eliminate.Right or Datos.X < Datos.Eliminate.Left or Datos.Y > Datos.Eliminate.Up or Datos.Y < Datos.Eliminate.Down then
			local tableaux2 = 0
			for j=1,#Datos.Bullets do
				Datos.Bullets[j - tableaux2].Remove()
				table.remove(Datos.Bullets, j - tableaux2)
				tableaux2 = tableaux2 + 1
			end
			table.remove(Snake, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	if Input.GetKey("Space") == 1 and not Dash and not HurtAnim and not murio then
		Dash = 0
		mult = 14/3.2
		numD = 0
		if EffectD then
			EffectD.Remove()
			EffectD = nil
		end
		EffectD = CreateSprite("JS&B Library Sprites/Explotion/1","BelowPlayer")
		EffectD.color = Cube.color
		EffectD.Scale(40/180, 40/180)
		EffectD.MoveTo(PosX, PosY)
	elseif Dash then
		Dash = Dash + 1
	end
	if EffectD then
		if numD < 6 then
			numD = numD + 1
			EffectD.Set("JS&B Library Sprites/Explotion/"..numD)
		else
			EffectD.Remove()
			EffectD = nil
			numD = nil
		end
	end
	if not murio and not HurtAnim then
		if Input.Left > 0 and Input.Right == 0 then
			PosX = PosX - 3.2*(mult or 1)
		elseif Input.Right > 0 and Input.Left == 0 then
			PosX = PosX + 3.2*(mult or 1)
		end
		if Input.Up > 0 and Input.Down == 0 then
			PosY = PosY + 3.2*(mult or 1)
		elseif Input.Down > 0 and Input.Up == 0 then
			PosY = PosY - 3.2*(mult or 1)
		end
		if Scroll then
			PosX = PosX + Scroll.X
			PosY = PosY + Scroll.Y
		end
		PosX = math.max(math.min(PosX, 632), 8)
		PosY = math.max(math.min(PosY, 472), 8)
	elseif not HurtAnim then
		if Scroll then
			PosX = PosX + Scroll.X
			PosY = PosY + Scroll.Y
		end
		if not rewind then
			rewind = 0
			Cube.alpha = 0
		end
		rewind = rewind + 1
		if rewind%10 == 0 and rewind <= 30 then
			for i=1,8 do
				Circle = CreateSprite("JS&B Library Sprites/Death","Top")
				Circle.Scale(60/480,60/480)
				table.insert(Death, {Sprite = Circle, Ang = 45*i})
			end
		end
		NewAudio.SetPitch("Song", math.max(NewAudio.GetPitch("Song") - 0.01, -2))
		if NewAudio.GetPitch("Song") < 0 then
			if not Efectos then
				Efectos = {CreateSprite("Pixel","Top"), CreateSprite("Pixel","Top"), CreateSprite("Pixel","Top"), CreateSprite("Pixel", "Top")}
				for i=1,#Efectos do
					Efectos[i].alpha = 0.5
					Efectos[i].Scale(640, 30)
					Efectos[i].MoveTo(320, -60 + 120*i)
				end
				for i=1,#Appear do
					Appear[i - tableaux].Bullet.Remove()
					table.remove(Appear, i - tableaux)
					tableaux = tableaux + 1
				end
				tableaux = 0
				for i=1,#Warnings do
					Warnings[i - tableaux].Sprite.Remove()
					table.remove(Warnings, i - tableaux)
					tableaux = tableaux + 1
				end
				tableaux = 0
				for i=1,#Circles do
					Circles[i - tableaux].Warn.Remove()
					Circles[i - tableaux].Bullet.Remove()
					table.remove(Circles, i - tableaux)
					tableaux = tableaux + 1
				end
				tableaux = 0
				for i=1,#Barras do
					local Datos = Barras[i - tableaux]
					Datos.Bullet.Remove()
					if Datos.Warn then
						Datos.Warn.Remove()
					end
					table.remove(Barras, i - tableaux)
					tableaux = tableaux + 1
				end
				tableaux = 0
				for i=1,#Barras2 do
					local Datos = Barras2[i - tableaux]
					Datos.Warn.Remove()
					Datos.Bullet.Remove()
					table.remove(Barras2, i - tableaux)
					tableaux = tableaux + 1
				end
				tableaux = 0
				for i=1,#Barras3 do
					local Datos = Barras3[i - tableaux]
					Datos.Warn.Remove()
					Datos.Bullet.Remove()
					table.remove(Barras3, i - tableaux)
					tableaux = tableaux + 1
				end
				tableaux = 0
			end
			backwards = true
		end
	end
	if Input.Left > 0 and Input.Right <= 0 and Input.Down > 0 and Input.Up <= 0 and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			Anykey = true
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if Cube.rotation > 45 and Cube.rotation < 225 then
			Cube.rotation = Cube.rotation - 45
		elseif Cube.rotation >= 225 or Cube.rotation < 45 then
			Cube.rotation = Cube.rotation + 45
		end
	elseif Input.Left > 0 and Input.Right <= 0 and Input.Down <= 0 and Input.Up > 0 and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			Anykey = true
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if Cube.rotation > 315 or Cube.rotation <= 135 then
			Cube.rotation = Cube.rotation - 45
		elseif Cube.rotation > 135 and Cube.rotation < 315 then
			Cube.rotation = Cube.rotation + 45
		end
	elseif Input.Left <= 0 and Input.Right > 0 and Input.Down > 0 and Input.Up <= 0 and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			Anykey = true
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if Cube.rotation > 135 and Cube.rotation < 315 then
			Cube.rotation = Cube.rotation - 45
		elseif Cube.rotation < 135 or Cube.rotation >= 315 then
			Cube.rotation = Cube.rotation + 45
		end
	elseif Input.Left <= 0 and Input.Right > 0 and Input.Down <= 0 and Input.Up > 0 and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			Anykey = true
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if Cube.rotation <= 45 or Cube.rotation > 225 then
			Cube.rotation = Cube.rotation - 45
		elseif Cube.rotation > 45 and Cube.rotation < 225 then
			Cube.rotation = Cube.rotation + 45
		end
	elseif Input.Left > 0 and Input.Right <= 0 and ((Input.Down <= 0 and Input.Up <= 0) or (Input.Down > 0 and Input.Up > 0)) and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			Anykey = true
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if Cube.rotation > 0 and Cube.rotation < 180 then
			Cube.rotation = Cube.rotation - 45
		elseif Cube.rotation >= 180 then
			Cube.rotation = Cube.rotation + 45
		end
	elseif Input.Left <= 0 and Input.Right > 0 and ((Input.Down <= 0 and Input.Up <= 0) or (Input.Down > 0 and Input.Up > 0)) and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if Cube.rotation == 0 or Cube.rotation > 180 then
			Cube.rotation = Cube.rotation - 45
		elseif Cube.rotation < 180 then
			Cube.rotation = Cube.rotation + 45
		end
	elseif ((Input.Left <= 0 and Input.Right <= 0) or (Input.Left > 0 and Input.Right > 0)) and Input.Down > 0 and Input.Up <= 0 and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			Anykey = true
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if Cube.rotation > 90 and Cube.rotation <= 270 then
			Cube.rotation = Cube.rotation - 45
		elseif (Cube.rotation < 360 and Cube.rotation > 270) or (Cube.rotation >= 0 and Cube.rotation < 90) then
			Cube.rotation = Cube.rotation + 45
		end
	elseif ((Input.Left <= 0 and Input.Right <= 0) or (Input.Left > 0 and Input.Right > 0)) and Input.Down <= 0 and Input.Up > 0 and not HurtAnim then
		stopanim = 0
		if not Dash then
			Cube.Scale(math.min(Cube.xscale + 1/46, 20/46), math.max(Cube.yscale - 1/46, 12/46))
		else
			Anykey = true
			if Dash > 10 then
				Cube.Scale(math.max(Cube.xscale - 0.2/46, 20/46), math.min(Cube.yscale + 0.2/46, 12/46))
				mult = mult - 14/32
				if mult <= 1 then
					Dash = nil
					mult = nil
					Anykey = nil
					Cube.Scale(20/46, 12/46)
				end
			else
				Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			end
		end
		if (Cube.rotation < 360 and Cube.rotation > 270) or (Cube.rotation >= 0 and Cube.rotation < 90) then
			Cube.rotation = Cube.rotation - 45
		elseif Cube.rotation >= 90 and Cube.rotation < 270 then
			Cube.rotation = Cube.rotation + 45
		end
	else
		if not Dash then
			if stopanim then
				stopanim = stopanim + 1
				Cube.Scale((16 + 4*math.cos(math.rad(630/15*stopanim)))/46, (16 - 4*math.cos(math.rad(630/15*stopanim)))/46)
				if stopanim == 15 then
					stopanim = nil
				end
			end
			if Cube.rotation > 0 and Cube.rotation < 180 then
				Cube.rotation = Cube.rotation - 45
			elseif Cube.rotation >= 180 then
				Cube.rotation = Cube.rotation + 45
			end
		else
			stopanim = 0
			Cube.Scale(math.min(Cube.xscale + 2/46, 24/46), math.max(Cube.yscale - 2/46, 8/46))
			if Cube.rotation == 0 or Cube.rotation > 180 then
				Cube.rotation = Cube.rotation - 45
			elseif Cube.rotation < 180 then
				Cube.rotation = Cube.rotation + 45
			end
			if not Anykey then
				PosX = math.min(PosX + 14, 632)
			end
			if Dash > 6 or Anykey then
				Dash = nil
				mult = nil
				Anykey = nil
			end
		end
	end
	if damaged and not murio then
		if not Invulnerabilidad then
			Invulnerabilidad = CreateSprite("JS&B Library Sprites/Meter/1","Top")
			CircleInv = CreateSprite("JS&B Library Sprites/Circle","BelowPlayer")
			CircleInv.color = {0.1,0.1,0.1}
			Invulnerabilidad.Scale(32/90, 32/90)
			CircleInv.Scale(28/480, 28/480)
		end
		damaged = damaged + 0.8
		Cube.color = {0.5 - 0.5*math.cos(math.rad(360/8*damaged)), (143.5 + 111.5*math.cos(math.rad(360/8*damaged)))/255, (183.5 + 71.5*math.cos(math.rad(360/8*damaged)))/255}
		Invulnerabilidad.Set("JS&B Library Sprites/Meter/"..math.min(math.ceil(damaged), 88))
		if damaged < 30 then
			Cube.rotation = -360*4/30*damaged
			PosX = math.max(math.min(PosX + 6*math.cos(math.rad(HurtAnim)), 632), 8)
			PosY = math.max(math.min(PosY + 6*math.sin(math.rad(HurtAnim)), 472), 8)
		end
		Invulnerabilidad.MoveTo(PosX, PosY)
		CircleInv.MoveTo(PosX, PosY)
		if damaged >= 88 then
			Invulnerabilidad.Remove()
			CircleInv.Remove()
			Invulnerabilidad = nil
			CircleInv = nil
			damaged = nil
		elseif damaged >= 30 and HurtAnim then
			Cube.rotation = 0
			HurtAnim = nil
		end
	end
	if (shakescreen or movement or desenfoque) and (rango or rangoD) then
		if shakescreen then
			shakescreen = shakescreen + 1
			intensidad = {math.random(-rango, rango), math.random(-rango, rango)}
			if desenfoque then
				if desenfoque[3] and rangoD > 0 then
					rangoD = rangoD - 0.2
				end
				intensidadEx = {rangoD*math.sin(math.rad(desenfoque[2]/0.5*(SongTime - desenfoque[1]))), rangoD*math.sin(math.rad(desenfoque[2]/0.3*(SongTime - desenfoque[1])))}
			else
				intensidadEx = {0, 0}
			end
		elseif movement then
			movement[1] = movement[1] + 1
			if movement[2] == "Down" then
				intensidad = {0, -rango*math.sin(math.rad(180/5*movement[1]))}
			elseif movement[2] == "Right" then
				intensidad = {rango*math.sin(math.rad(180/5*movement[1])), 0}
			elseif movement[2] == "Up" then
				intensidad = {0, rango*math.sin(math.rad(180/5*movement[1]))}
			elseif movement[2] == "Left" then
				intensidad = {-rango*math.sin(math.rad(180/5*movement[1])), 0}
			end
			if desenfoque then
				if desenfoque[3] and rangoD > 0 then
					rangoD = rangoD - 0.2
				end
				intensidadEx = {rangoD*math.sin(math.rad(desenfoque[2]/0.5*(SongTime - desenfoque[1]))), rangoD*math.sin(math.rad(desenfoque[2]/0.3*(SongTime - desenfoque[1])))}
			else
				intensidadEx = {0, 0}
			end
		elseif desenfoque then
			if desenfoque[3] and rangoD > 0 then
				rangoD = rangoD - 0.2
			end
			intensidad = {0, 0}
			intensidadEx = {rangoD*math.sin(math.rad(desenfoque[2]/0.5*(SongTime - desenfoque[1]))), rangoD*math.sin(math.rad(desenfoque[2]/0.3*(SongTime - desenfoque[1])))}
		end
		if Invulnerabilidad then
			Invulnerabilidad.MoveTo(PosX + intensidad[1] + intensidadEx[1], PosY + intensidad[2] + intensidadEx[2])
		end
		if CircleInv then
			CircleInv.MoveTo(PosX + intensidad[1] + intensidadEx[1], PosY + intensidad[2] + intensidadEx[2])
		end
		Player.MoveToAbs(PosX + intensidad[1] + intensidadEx[1], PosY + intensidad[2] + intensidadEx[2], true)
		Cube.MoveTo(PosX + intensidad[1] + intensidadEx[1], PosY + intensidad[2] + intensidadEx[2])
		for i=1,#Appear do
			Appear[i].Bullet.MoveToAbs(Appear[i].X + intensidad[1] + intensidadEx[1], Appear[i].Y + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Zoom_in_out do
			Zoom_in_out[i].Bullet.MoveToAbs(Zoom_in_out[i].X + intensidad[1] + intensidadEx[1], Zoom_in_out[i].Y + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Warnings do
			Warnings[i].Sprite.MoveTo(Warnings[i].X + intensidad[1] + intensidadEx[1], Warnings[i].Y + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Caida do
			Caida[i].Bullet.MoveToAbs(Caida[i].X + intensidad[1] + intensidadEx[1], Caida[i].Y + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Montes do
			if Montes[i].Direction%2 == 0 then
				Montes[i].Bullet.Body.sprite.rotation = 90
				Montes[i].Bullet.Body.MoveToAbs(-30 + 700*math.cos(math.rad(45*Montes[i].Direction)) - Montes[i].Bullet.Body.sprite.yscale*math.cos(math.rad(90*Montes[i].Direction))/2 + intensidad[1] + intensidadEx[1], Montes[i].Y + intensidad[2] + intensidadEx[2])
				Montes[i].Bullet.Head.MoveToAbs(-30 + 700*math.cos(math.rad(45*Montes[i].Direction)) - Montes[i].Bullet.Body.sprite.yscale*math.cos(math.rad(90*Montes[i].Direction)) + intensidad[1] + intensidadEx[1], Montes[i].Y + intensidad[2] + intensidadEx[2])
			else
				Montes[i].Bullet.Body.MoveToAbs(Montes[i].X + intensidad[1] + intensidadEx[1], -30 + 540*math.sin(math.rad(45*Montes[i].Direction + 45)) - Montes[i].Bullet.Body.sprite.yscale*math.sin(math.rad(90*Montes[i].Direction))/2 + intensidad[2] + intensidadEx[2])
				Montes[i].Bullet.Head.MoveToAbs(Montes[i].X + intensidad[1] + intensidadEx[1], -30 + 540*math.sin(math.rad(45*Montes[i].Direction + 45)) - Montes[i].Bullet.Body.sprite.yscale*math.sin(math.rad(90*Montes[i].Direction)) + intensidad[2] + intensidadEx[2])
			end
		end
		for i=1,#Generator do
			Generator[i].Trail.MoveTo(Generator[i].PX + (Generator[i].Distancia/(Generator[i].Eliminate - Generator[i].Appear)*math.max(SongTime - Generator[i].Appear, 0))*math.cos(math.rad(Generator[i].Movement)) + intensidad[1] + intensidadEx[1], Generator[i].PY + (Generator[i].Distancia/(Generator[i].Eliminate - Generator[i].Appear)*math.max(SongTime - Generator[i].Appear, 0))*math.sin(math.rad(Generator[i].Movement)) + intensidad[2] + intensidadEx[2])
			for j=1,#Generator[i].Saws do
				Generator[i].Saws[j].Bullet.MoveToAbs(Generator[i].PX + (Generator[i].Distancia/(Generator[i].Eliminate - Generator[i].Appear)*(SongTime - Generator[i].Appear))*math.cos(math.rad(Generator[i].Movement)) + Generator[i].Saws[j].PX + intensidad[1] + intensidadEx[1], Generator[i].PY + (Generator[i].Distancia/(Generator[i].Eliminate - Generator[i].Appear)*math.max(SongTime - Generator[i].Appear, 0))*math.sin(math.rad(Generator[i].Movement)) + Generator[i].Saws[j].PY + intensidad[2] + intensidadEx[2])
			end
		end
		for i=1,#Circles do
			Circles[i].Warn.MoveTo(Circles[i].X + intensidad[1] + intensidadEx[1], Circles[i].Y + intensidad[2] + intensidadEx[2])
			Circles[i].Bullet.MoveToAbs(Circles[i].X + intensidad[1] + intensidadEx[1], Circles[i].Y + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Barras3 do
			local Datos = Barras3[i]
			Datos.Warn.MoveTo(Datos.PX + Datos.Warn.xscale/2*math.cos(math.rad(Datos.Ang)) + intensidad[1] + intensidadEx[1], Datos.PY + Datos.Warn.xscale/2*math.sin(math.rad(Datos.Ang)) + intensidad[2] + intensidadEx[2])
			Datos.Bullet.MoveToAbs(Datos.PX + Datos.Bullet.sprite.xscale/2*math.cos(math.rad(Datos.Ang)) + intensidad[1] + intensidadEx[1], Datos.PY + Datos.Bullet.sprite.xscale/2*math.sin(math.rad(Datos.Ang)) + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Barras2 do
			local Datos = Barras2[i]
			Datos.Warn.MoveTo(Datos.PX + 450*math.cos(math.rad(Datos.Ang)) + intensidad[1] + intensidadEx[1], Datos.PY + 450*math.sin(math.rad(Datos.Ang)) + intensidad[2] + intensidadEx[2])
			Datos.Bullet.MoveToAbs(Datos.PX + 450*math.cos(math.rad(Datos.Ang)) + intensidad[1] + intensidadEx[1], Datos.PY + 450*math.sin(math.rad(Datos.Ang)) + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Barras do
			local Datos = Barras[i]
			if Datos.Direction%2 == 0 then
				Datos.Bullet.MoveToAbs(320 - (320 - Datos.Bullet.sprite.xscale/2)*math.cos(math.rad(90*Datos.Direction)), Datos.PY + intensidad[2] + intensidadEx[2])
				if Datos.Warn then
					Datos.Warn.MoveTo(320, Datos.PY + intensidad[2] + intensidadEx[2])
				end
			else
				Datos.Bullet.MoveToAbs(Datos.PX + intensidad[1] + intensidadEx[1], 240 - (240 - Datos.Bullet.sprite.yscale/2)*math.sin(math.rad(90*Datos.Direction)))
				if Datos.Warn then
					Datos.Warn.MoveTo(Datos.PX + intensidad[1] + intensidadEx[1], 240)
				end
			end
		end
		for i=1,#Explotions do
			local Datos = Explotions[i]
			if Datos.Bullet.isactive then
				if SongTime <= Datos.Eliminate - Datos.Stay/60 then
					Datos.Bullet.MoveToAbs(Datos.PX + Datos.X*math.sin(math.rad(90/((Datos.Eliminate - Datos.Appear) - Datos.Stay/60)*(SongTime - Datos.Appear))) + intensidad[1] + intensidadEx[1], Datos.PY + Datos.Y*math.sin(math.rad(90/((Datos.Eliminate - Datos.Appear) - Datos.Stay/60)*(SongTime - Datos.Appear))) + intensidad[2] + intensidadEx[2])
				else
					Datos.Bullet.MoveToAbs(Datos.PX + Datos.X + intensidad[1] + intensidadEx[1], Datos.PY + Datos.Y + intensidad[2] + intensidadEx[2])
				end
			else
				for j=1,#Datos.Explosives do
					local Misil = Datos.Explosives[j]
					Misil.Bullet.MoveToAbs(Datos.PX + Datos.X + Misil.Vel/(1/60)*(SongTime - Datos.Eliminate)*math.cos(math.rad(Misil.Ang)) + 4*math.cos(math.rad(Datos.Ondulacion + Misil.Ang)) + intensidad[1] + intensidadEx[1], Datos.PY + Datos.Y + Misil.Vel/(1/60)*(SongTime - Datos.Eliminate)*math.sin(math.rad(Misil.Ang)) + 4*math.sin(math.rad(Datos.Ondulacion + Misil.Ang)) + intensidad[2] + intensidadEx[2])
				end
			end
		end
		for i=1,#Bullets do
			Bullets[i].MoveToAbs(Bullets[i].GetVar("X") + intensidad[1] + intensidadEx[1], Bullets[i].GetVar("Y") + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Movement do
			local Datos = Movement[i]
			Datos.Bullet.MoveToAbs(Datos.X2 + intensidad[1] + intensidadEx[1], Datos.Y2 + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Fall do
			Fall[i].Bullet.MoveToAbs(Fall[i].PX + intensidad[1] + intensidadEx[1], Fall[i].PY + intensidad[2] + intensidadEx[2])
		end
		for i=1,#Snake do
			local Datos = Snake[i]
			for j=1,#Datos.Bullets do
				if Datos.Direction%2 == 0 then
					Datos.Bullets[j].MoveToAbs(Datos.X + Datos.Espaciado*(j - 1)*((Datos.Direction%4*2 - 2)/2) + intensidad[1] + intensidadEx[1], Datos.Y + Datos.Height*math.sin(math.rad(Datos.Bullets[j].GetVar("Ang"))) + intensidad[2] + intensidadEx[2])
				else
					Datos.Bullets[j].MoveToAbs(Datos.X + Datos.Height*math.sin(math.rad(Datos.Bullets[j].GetVar("Ang"))) + intensidad[1] + intensidadEx[1], Datos.Y + Datos.Espaciado*(j - 1)*(((Datos.Direction - 1)%4*2 - 2)/2) + intensidad[2] + intensidadEx[2])
				end
			end
		end
		for i=1,#CheckPoints2 do
			local sprite = CheckPoints2[i]
			if SongTime > sprite.GetVar("Data")[1] and not sprite.GetVar("Data")[2] then
				sprite.GetVar("Data")[2] = true
				local linea = CreateSprite("JS&B Library Sprites/CheckPoint","BelowBullet")
				linea.MoveTo(642, 240)
				sprite.GetVar("Data")[3] = linea
			elseif sprite.GetVar("Data")[2] and sprite.GetVar("Data")[3] then
				sprite.GetVar("Data")[3].MoveTo(642 - 180*(SongTime - sprite.GetVar("Data")[1]) + intensidad[1] + intensidadEx[1], 240 + intensidad[2] + intensidadEx[2])
				if sprite.GetVar("Data")[3].x <= Cube.x + 4 and not murio then
					local colors = {{47/255,46/255,48/255}, {0,16/255,26/255}, {1/255,39/255,49/255}, {11/255,14/255,16/255}, {58/255,35/255,62/255}, {73/255,7/255,53/255}}
					local selector = nil
					repeat
						selector = colors[math.random(#colors)]
					until BGcolor ~= selector
					BGcolor = selector
					BG.color = BGcolor
					cegar = 0
					Audio.PlaySound("checkpoint")
					CheckPoints[i] = true
					sprite.GetVar("Data")[3].Remove()
					sprite.GetVar("Data")[3] = nil
				end
			end
		end
		if (shakescreen and shakescreen == 10) or (movement and movement[1] == 5) or (rangoD and rangoD <= 0) then
			if (shakescreen and shakescreen == 10) or (movement and movement[1] == 5) then
				shakescreen = nil
				movement = nil
				intensidad = nil
				intensidadEx = nil
				rango = nil
			end
			if rangoD and rangoD <= 0 then
				desenfoque = nil
				rangoD = nil
			end
		end
	else
		Player.MoveToAbs(PosX, PosY, true)
		Cube.MoveTo(PosX, PosY)
		for i=1,#CheckPoints2 do
			local sprite = CheckPoints2[i]
			if SongTime > sprite.GetVar("Data")[1] and not sprite.GetVar("Data")[2] then
				sprite.GetVar("Data")[2] = true
				local linea = CreateSprite("JS&B Library Sprites/CheckPoint","BelowBullet")
				linea.MoveTo(642, 240)
				sprite.GetVar("Data")[3] = linea
			elseif sprite.GetVar("Data")[2] and sprite.GetVar("Data")[3] then
				sprite.GetVar("Data")[3].MoveTo(642 - 180*(SongTime - sprite.GetVar("Data")[1]), 240)
				if sprite.GetVar("Data")[3].x <= Cube.x + 4 and not murio then
					local colors = {{47/255,46/255,48/255}, {0,16/255,26/255}, {1/255,39/255,49/255}, {11/255,14/255,16/255}, {58/255,35/255,62/255}, {73/255,7/255,53/255}}
					local selector = nil
					repeat
						selector = colors[math.random(#colors)]
					until BGcolor ~= selector
					BGcolor = selector
					BG.color = BGcolor
					cegar = 0
					Audio.PlaySound("checkpoint")
					CheckPoints[i] = true
					sprite.GetVar("Data")[3].Remove()
					sprite.GetVar("Data")[3] = nil
				end
			end
		end
	end
	if cegar then
		if cegar == 0 then
			Cegador.alpha = 0.5
			cegar = 1
		else
			Cegador.alpha = Cegador.alpha - 0.05
			if Cegador.alpha <= 0 then
				cegar = nil
			end
		end
	end
	for i=1,#Death do
		local Datos = Death[i - tableaux]
		Datos.Sprite.SendToTop()
		if not Datos.Lenght then
			Datos.Lenght = 0
		end
		Datos.Lenght = Datos.Lenght + 8
		if Datos.Lenght >= 100 then
			Datos.Sprite.Scale(Datos.Sprite.xscale - 4/480, Datos.Sprite.yscale - 4/480)
		end
		if intensidad then
			Datos.Sprite.MoveTo(PosX + Datos.Lenght*math.cos(math.rad(Datos.Ang)) + intensidad[1], PosY + Datos.Lenght*math.sin(math.rad(Datos.Ang)) + intensidad[2])
		else
			Datos.Sprite.MoveTo(PosX + Datos.Lenght*math.cos(math.rad(Datos.Ang)), PosY + Datos.Lenght*math.sin(math.rad(Datos.Ang)))
		end
		if Datos.Sprite.xscale <= 0 then
			Datos.Sprite.Remove()
			table.remove(Death, i - tableaux)
			tableaux = tableaux + 1
		end
	end
	tableaux = 0
	if frame < 88/maxhits*hits then
		frame = frame + 0.25
		Cube.Set("JS&B Library Sprites/Cube/"..math.floor(frame))
	end
	if Efectos then
		for i=1,#Efectos do
			Efectos[i].MoveTo(320, -60 + 120*i + math.random(-6,6))
			Efectos[i].alpha = 0.1*math.random(4,6)
		end
	end
	if rewind == 300 then
		Audio.PlaySound("checkpoint")
		for i=1,#CheckPoints2 do
			local sprite = CheckPoints2[i]
			if not CheckPoints[i] then
				sprite.GetVar("Data")[2] = false
			end
			if sprite.GetVar("Data")[3] then
				sprite.GetVar("Data")[3].Remove()
				sprite.GetVar("Data")[3] = nil
			end
		end
		for i=1,#Appear do
			Appear[i - tableaux].Bullet.Remove()
			table.remove(Appear, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Zoom_in_out do
			Zoom_in_out[i - tableaux].Bullet.Remove()
			table.remove(Zoom_in_out, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Warnings do
			Warnings[i - tableaux].Sprite.Remove()
			table.remove(Warnings, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Caida do
			Caida[i - tableaux].Bullet.Remove()
			table.remove(Caida, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Montes do
			Montes[i - tableaux].Bullet.Body.Remove()
			Montes[i - tableaux].Bullet.Head.Remove()
			table.remove(Montes, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Generator do
			local Datos = Generator[i - tableaux]
			local tableaux2 = 0
			for j=1,#Datos.Saws do
				Datos.Saws[j - tableaux2].Bullet.Remove()
				table.remove(Datos.Saws, j - tableaux2)
				tableaux2 = tableaux2 + 1
			end
			Datos.Trail.Remove()
			table.remove(Generator, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Circles do
			Circles[i - tableaux].Warn.Remove()
			Circles[i - tableaux].Bullet.Remove()
			table.remove(Circles, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Barras do
			local Datos = Barras[i - tableaux]
			Datos.Bullet.Remove()
			if Datos.Warn then
				Datos.Warn.Remove()
			end
			table.remove(Barras, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Barras2 do
			local Datos = Barras2[i - tableaux]
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Barras2, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Barras3 do
			local Datos = Barras3[i - tableaux]
			Datos.Warn.Remove()
			Datos.Bullet.Remove()
			table.remove(Barras3, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Explotions do
			local Datos = Explotions[i - tableaux]
			if Datos.Bullet.isactive then
				Datos.Bullet.Remove()
			else
				local tableaux2 = 0
				for j=1,#Datos.Explosives do
					Datos.Explosives[j - tableaux2].Bullet.Remove()
					table.remove(Datos.Explosives, j - tableaux2)
					tableaux2 = tableaux2 + 1
				end
			end
			table.remove(Explotions, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Bullets do
			Bullets[i - tableaux].Remove()
			table.remove(Bullets, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Movement do
			Movement[i - tableaux].Bullet.Remove()
			table.remove(Movement, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Fall do
			Fall[i - tableaux].Bullet.Remove()
			table.remove(Fall, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Snake do
			local Datos = Snake[i - tableaux]
			for j=1,#Datos.Bullets do
				Datos.Bullets[j].Remove()
			end
			table.remove(Snake, i - tableaux)
			tableaux = tableaux + 1
		end
		tableaux = 0
		for i=1,#Efectos do
			Efectos[i].Remove()
		end
		Scroll = nil
		Efectos = nil
		PosX = 160
		PosY = 240
		frame = 1
		Cube.Set("JS&B Library Sprites/Cube/1")
		Muerte.alpha = 1
		Muerte.color = {1,1,1}
		NewAudio.SetPitch("Song", 1)
		NewAudio.SetPlayTime("Song", 0)
		NewAudio.Pause("Song")
		murio = nil
		damaged = nil
		backwards = nil
		shakescreen = nil
		movement = nil
		intensidad = nil
		intensidadEx = nil
		desenfoque = nil
		rango = nil
		rangoD = nil
		rewind = nil
		cegar = nil
		stopanim = nil
		Cube.alpha = 1
		Cegador.alpha = 0
		Reset()
	end
	if Anim2 then
		Anim2.SendToTop()
	end
	if Anim1 then
		Anim1.SendToTop()
	end
	if MedidorT then
		MedidorT.SendToTop()
	end
	if Triangulo then
		Triangulo.SendToTop()
	end
	if IndicadorM then
		IndicadorM.SendToTop()
	end
	Cegador.SendToTop()
	Muerte.SendToTop()
	if Muerte.alpha > 0 then
		if murio then
			Muerte.alpha = Muerte.alpha - 0.01
		else
			Muerte.alpha = Muerte.alpha - 0.04
		end
	end
end

function SpawnMeter(num)
	Long = 0
	Largo = num
end

function DespawnMeter()
	if not Unlong then
		Unlong = 0
	end
end

function SetMaxHits(num)
	maxhits = num
end

function RemoveAll()
	Cube.Remove()
	Cegador.Remove()
	Muerte.Remove()
	if Efectos then
		for i=1,#Efectos do
			Efectos[i].Remove()
		end
	end
	if EffectD then
		EffectD.Remove()
	end
	if Invulnerabilidad then
		Invulnerabilidad.Remove()
	end
	if CircleInv then
		CircleInv.Remove()
	end
	if Anim2 then
		Anim2.Remove()
	end
	if Anim1 then
		Anim1.Remove()
	end
	if MedidorT then
		MedidorT.Remove()
	end
	if Triangulo then
		Triangulo.Remove()
	end
	if IndicadorM then
		IndicadorM.Remove()
	end
	for i=1,#Warnings do
		Warnings[i].Sprite.Remove()
	end
	for i=1,#Generator do
		Generator[i].Trail.Remove()
	end
	for i=1,#Circles do
		Circles[i].Warn.Remove()
	end
	for i=1,#Barras3 do
		Barras3[i].Warn.Remove()
	end
	for i=1,#Barras2 do
		Barras2[i].Warn.Remove()
	end
	for i=1,#Barras do
		if Barras[i].Warn then
			Barras[i].Warn.Remove()
		end
	end
	for i=1,#Death do
		Death[i].Sprite.Remove()
	end
	for i=1,#CheckPoints2 do
		local sprite = CheckPoints2[i]
		if sprite.GetVar("Data")[3] then
			sprite.GetVar("Data")[3].Remove()
			sprite.GetVar("Data")[3] = nil
		end
		sprite.Remove()
	end
end