
//Here's 2.1 Knuckles physics!

addHook("ThinkFrame", do
	for player in players.iterate
        if player.mo == nil then continue end
        if player.mo.skin ~= "2.1knuckles" then
            continue
        end
		if (player.mo.state == S_PLAY_GLIDE) and not P_IsObjectOnGround(player.mo)
			if (player.powers[pw_super])
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(42*FRACUNIT, player.mo.scale))
			elseif (player.powers[pw_super]) and (player.mo.eflags & MFE_UNDERWATER)
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(28*FRACUNIT, player.mo.scale))
			elseif (player.mo.eflags & MFE_UNDERWATER)
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(14*FRACUNIT, player.mo.scale))
			else
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(26*FRACUNIT, player.mo.scale))
			end
		end
		if (player.mo.state == S_PLAY_GLIDE_LANDING)
			S_StopSound(player.mo)
			P_ResetPlayer(player)
			S_StopSound(player.mo)
			player.mo.state = S_PLAY_WALK
		end
	end
end)

//The only thing that's missing, is when he's gliding, when he's holding either left or right, it should insta thrust him left or right too a little
//The next update is, he must gain 1*FRACUNIT in his gliding speed every second.