------ All content © 2008 DigiPen (USA) Corporation, all rights reserved. ------
-- Author: Hamza M. Hutchinson
-- Updated: 2/18/2008

local myData = Entity:Data()
local collided = false
local x = 0
local y = 0
local z = 0

local function WithStuff( theKey, theValue )
  local theName = theValue:GetName()
  if( string.find( theName, "Aster" ) ~= nil )
  then
    collided = true
  end
end

while( 1 )
do
  coroutine.yield()

  --check collisions
  Entity:PHY_Refresh( myData, true )
  table.foreach( myData.collisions, WithStuff )

  --spin this bitch
  x = x + 3
  y = y + 4
  z = z + 5
  Entity:SHR_sRotation(x, y, z)

  --waste this bitch
  if( collided )
  then
    Global:AddScarfSegment()
    Global:DeleteEntityByPtr( Entity:GetMyPointer() )
  end

end