local spin = LoadActor('../bg.png')

local steps = {(GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty()), (GAMESTATE:GetCurrentSteps(PLAYER_1):GetDifficulty())}

function spin:OnCommand()
	local screen = SCREENMAN:GetTopScreen()
	if screen then	
		for i=1, 2 do
			local field = screen:GetChild('PlayerP'..i)
			
			--only do the spin if you're playing challenge, and the notefield actually exists
			if field and steps[i] == "Difficulty_Challenge" then
				field:sleep(74.483+2.2); --why 2.2?
				field:rotationy(0)
				field:decelerate(1.6)
				field:rotationy(360 * (i==1 and -4 or 4)) --logic trick :)
			end
			
		end
	end
end

return spin