Ejemplo n.º 1
0
//----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));
	}
}
Ejemplo n.º 2
0
void Update()
{
	g_bAllCaveSearched = true;

	for (int i = 0; i < g_iNbrCave; i++)
	{
		if (g_bCaveSearched[i] == false)
		{
			g_bAllCaveSearched = false;
		}
	}
	
	PlayerState_Update();
	GfxSpriteSetPosition(g_pLines, g_TPlayerData.iPos.x, g_TPlayerData.iPos.y);
	GfxLineSpriteReset(g_pLines2);
	GfxLineSpriteJumpTo(g_pLines2, g_TPlayerData.iPos.x, g_TPlayerData.iPos.y);
	GfxLineSpriteLineTo(g_pLines2, g_pCave[g_iCurrentCaveTarget].iPosX, g_pCave[g_iCurrentCaveTarget].iPosY);
}