LD = require("design.LevelDesignLibrary")
thisObj = nil
thisLevel = nil
player = nil
son = nil
cwCollisionGroup = nil
ccwCollisionGroup = nil
rotateObj = nil
SNDAxeSpinDreadLock = nil
function OnScriptLoaded(level, obj)
  thisObj = obj
  thisLevel = level
  player = game.Player.FindPlayer()
  son = game.AI.FindSon()
  cwCollisionGroup = obj:FindSingleGOByName("Collision_RotateCW")
  ccwCollisionGroup = obj:FindSingleGOByName("Collision_RotateCCW")
  cwCollisionGroup.LuaObjectScript.RegisterHitCallback(RotateClockwise)
  ccwCollisionGroup.LuaObjectScript.RegisterHitCallback(RotateCounterClockwise)
  rotateObj = obj:FindSingleGOByName("RotateGroup")
  rotateObj:JumpAnimToFrame(0)
  rotateObj:PauseAnim()
  SNDAxeSpinDreadLock = obj:FindSingleSoundEmitterByName("SNDAxeSpinDreadLock")
end
function OnUpdate(level, obj)
end
function RotateClockwise()
  rotateObj:PlayAnimToFrame(20)
  AudioAxeSpin()
end
function RotateCounterClockwise()
  rotateObj:PlayAnimToFrame(0, -1)
  AudioAxeSpin()
end
function AudioAxeSpin()
  if thisObj:FindSingleSoundEmitterByName("SNDAxeSpinDreadLock") ~= nil then
    SNDAxeSpinDreadLock:Start("SND_EVNT_Stone_Mason_Dreadlock_Hit_Rotate")
  end
end
function OnSaveCheckpoint(level, obj)
  return {}
end
function OnRestoreCheckpoint(level, obj, savedInfo)
end
