//----Show
void TBox::DrawBox()
{
	if (m_pSprite != nullptr)
	{
		GfxSpriteSetPosition(m_pSprite, m_tCenter.x, m_tCenter.y);
		GfxSpriteSetAngle(m_pSprite, GfxMathDegToRad(-m_fAngle));
	}

	//Line
	if (m_pLineSprite != nullptr)
	{
		if (m_pLineSprite != nullptr)
			GfxLineSpriteReset(m_pLineSprite);

		GfxLineSpriteSetDrawingColor(m_pLineSprite, GfxColor(150, 150, 150, 255));
		TGfxVec2 tAxisX = TGfxVec2(m_fRay_W, 0).Rotate(GfxMathDegToRad(m_fAngle))*m_fScale;
		TGfxVec2 tAxisY = TGfxVec2(0, m_fRay_H).Rotate(GfxMathDegToRad(m_fAngle))*m_fScale;

		TGfxVec2 tUR = TGfxVec2(m_tCenter.x + tAxisX.x + tAxisY.x, m_tCenter.y + tAxisX.y + tAxisY.y);
		TGfxVec2 tUL = TGfxVec2(m_tCenter.x - tAxisX.x + tAxisY.x, m_tCenter.y - tAxisX.y + tAxisY.y);
		TGfxVec2 tDL = TGfxVec2(m_tCenter.x - tAxisX.x - tAxisY.x, m_tCenter.y - tAxisX.y - tAxisY.y);
		TGfxVec2 tDR = TGfxVec2(m_tCenter.x + tAxisX.x - tAxisY.x, m_tCenter.y + tAxisX.y - tAxisY.y);

		GfxLineSpriteJumpTo(m_pLineSprite, tUL.x, tUL.y);
		GfxLineSpriteLineTo(m_pLineSprite, tDL.x, tDL.y);
		GfxLineSpriteLineTo(m_pLineSprite, tDR.x, tDR.y);
		GfxLineSpriteLineTo(m_pLineSprite, tUR.x, tUR.y);
		GfxLineSpriteLineTo(m_pLineSprite, tUL.x, tUL.y);
	}
	if (m_pTextSprite != nullptr)
	{
		GfxSpriteSetPosition(m_pTextSprite, m_tCenter.x, m_tCenter.y);
		GfxSpriteSetAngle(m_pTextSprite,GfxMathDegToRad(-m_fAngle));
	}
}
Example #2
0
void GameOver()
{
    IsGameOver = true;
    GfxSpriteSetAngle(g_pSpriteHero, -(M_PI / 2));
}