function main(self)
	if self.State == 0 then
		self.State = 1
		self.Flags.AlwaysActive = true
		self.BumpFlags.EnemyBullet = true
		self.AttackFlags.Player = true
		self.HitFlags.MagicBullet = true
		self.PhysicsType = PhysicsTypes.Fly
		if self.Direction == 4 then
			self.DrawFlags.Mirror = true
			self.AttackRect, self.MoveRect, self.HitRect = {-48,-16,4,16}, {-44,-12,4,12}, {-48,-16,4,16}
		end
		if self.Direction == 6 then
			self.AttackRect, self.MoveRect, self.HitRect = {-4,-16,48,16}, {-4,-12,44,12}, {-4,-16,48,16}
		end
		self:SetImage("GAME_PROJECTILES_ICESWORD")
		self:SetAnimation("GAME_CYCLE100")
		self.XMin, self.XMax = self.X - self.Width, self.X + self.Width
	end

	if self.State == 1 then
		self:AnimationStep()
		self:Physics(self.X + self.SpeedX, self.Y)
		if self.X <= self.XMin or self:Physics(self.X + self.SpeedX, self.Y) > 0 then
			self:Destroy()
		end
	end
end

function attack(self)
	CreateObject {x=self.X, y=self.Y, z=6000, name="IceBallExplosion"}
	PlaySound("CLAW_ICESWORD")
	self:Destroy()
end

function hit(self)
	CreateObject {x=self.X, y=self.Y, z=6000, name="IceBallExplosion"}
	PlaySound("CLAW_ICESWORD")
	self:Destroy()
end