Constructor CStateEnd::CStateEnd() Using CGameState(EGS_End)
	m_iGameOverTxtID = agk::CreateText("GAME OVER")
	agk::SetTextPosition(m_iGameOverTxtID, 130, 160)
	agk::SetTextSize(m_iGameOverTxtID, 40)
	agk::FixTextToScreen(m_iGameOverTxtID, 1)
	agk::SetTextColorAlpha(m_iGameOverTxtID, 0)
	agk::SetTextVisible(m_iGameOverTxtID, 0)
End Constructor

Destructor CStateEnd::~CStateEnd()

End Destructor

Function CStateEnd::Run(fFrameTime As float) As EGameState
	Static add As integer
	add = 4
	Raw As UINT alpha = agk::GetTextColorAlpha(m_iGameOverTxtID)
	If alpha = 255 Or (alpha < 32 And add < 0) Then add = -add
	agk::SetTextColorAlpha(m_iGameOverTxtID, alpha + add)
	agk::SetTextVisible(m_iGameOverTxtID, 1)
	m_refAliens->UpdateAliens()
	if agk::GetPointerPressed() Then
		agk::SetTextColorAlpha(m_iGameOverTxtID, 0)
		agk::SetTextVisible(m_iGameOverTxtID, 0)
		Function = EGS_Start
	EndIf
	
	Function = m_eState
End Function

Sub CStateEnd::Reset()
	agk::SetTextColorAlpha(m_iGameOverTxtID, 0)
	agk::SetTextVisible(m_iGameOverTxtID, 0)
End Sub
