-- See logic "SilentTeleportLineTrigger" for instruction

function main(self)
	if self.State == 0 then
		self.State = 1
		self.HitFlags.Player = true
		self.HitRect = {-12,-24,12,24}
	end

	if self.State == 2 and GetTime() > self.timeCounter then
		self:SetFrame(3)
		self.State = 2
	end
end

function hit(self)
	if self.State == 1 then
		self.HitFlags.Player = false
		PlaySound("CUSTOM_LEVER")
		CreateObject{
			X = self.XTweak,
			Y = self.YTweak,
			name = "SilentTeleportLine",
			Direction = self.Direction,
			SpeedX = self.SpeedX,
			SpeedY = self.SpeedY,
			Width = self.Width,
			Height = self.Height,
			Smarts = self.Smarts
		}
		self:SetFrame(2)
		self.timeCounter = GetTime() + 100
		self.State = 2
	end
end