void DrawGround()
{
	for (int i = 0; i < NUM_BUILDINGS; i++) {
		Iw2DSetColour(0xff000000);
		Iw2DFillRect(CIwFVec2(GAME_WIDTH - buildings_pos[i].x, GAME_HEIGHT - buildings_pos[i].y),
					 CIwFVec2(buildings_dim[i].x, buildings_dim[i].y));
		Iw2DSetColour(0xffffffff);
		Iw2DDrawRect(CIwFVec2(GAME_WIDTH - buildings_pos[i].x, GAME_HEIGHT - buildings_pos[i].y),
					 CIwFVec2(buildings_dim[i].x, buildings_dim[i].y));
	}
}
Пример #2
0
//Visualize clicks
void Brixpath::customAnimation(){
    
    CIwArray<clickAnimation*> toRemove;
    
    IW_ARRAY_ITERATE_INT(i, _clicksToAnimate)
    {
        clickAnimation* ca = &_clicksToAnimate[i];
        
        if(ca->currentWidth > _animationOptions.limit) //if rectangle is bigger than limit, animation should be stopped
            toRemove.push_back(&_clicksToAnimate[i]);
        else
        {
            _clicksToAnimate[i].currentWidth += _animationOptions.step; //increase rectangle size and draw it.
            Iw2DDrawRect(CIwSVec2((int)(ca->x - (ca->currentWidth/2)), (int)(ca->y - (ca->currentWidth/2))), CIwSVec2(ca->currentWidth, ca->currentWidth));
        }
    }
void FindTheSpotGameEngine::Render(CIwRect& bounds)
{
	CIwSVec2 imgBounds(bounds.x, bounds.y);
	Utils::AlphaRenderImage(g_pLogoTexture, imgBounds, 0xff);

	float tileSize = 160.0f;

	if (g_finalScore == 0)
	{
		CIwRect tileBounds(bounds.x + (bounds.w - tileSize) / 2, bounds.y + (bounds.h - tileSize) / 2, tileSize, tileSize);
		Utils::AlphaRenderImage(g_pTile, tileBounds, 255);

		CIwColour white;
		white.Set(0xff, 0xff, 0xff, 0x7f);

		float scale = tileSize / 256.0f;

		Iw2DSetColour(white);
		Iw2DDrawRect(CIwSVec2(tileBounds.x-1, tileBounds.y-1), CIwSVec2(tileBounds.w+2, tileBounds.h+2));
		CIwSVec2 spotLoc(tileBounds.x + (g_tileLoc.x * scale) - (g_pCursorTexture->GetWidth() / 2), tileBounds.y + (g_tileLoc.y * scale) - (g_pCursorTexture->GetHeight() / 2));
		Utils::AlphaRenderImage(g_pCursorTexture, spotLoc, 255);
		
		if (g_renderTemp == 1)
		{
			CIwSVec2 imgBounds(bounds.x, bounds.y + bounds.h - g_pColderTexture->GetHeight());
			Utils::AlphaRenderImage(g_pColderTexture, imgBounds, 255);
		}
		else if (g_renderTemp == 2)
		{
			CIwSVec2 imgBounds(bounds.x, bounds.y + bounds.h - g_pHotterTexture->GetHeight());
			Utils::AlphaRenderImage(g_pHotterTexture, imgBounds, 255);
		}
	}
	else
	{
		tileSize = g_pFoundTexture->GetWidth();
		CIwRect tileBounds(bounds.x + (bounds.w - tileSize) / 2, bounds.y + (bounds.h - tileSize) / 2, tileSize, tileSize);

		Utils::AlphaRenderImage(g_pFoundTexture, tileBounds, 255);
	}
}
void DrawGameBackground()
{
	Iw2DSetColour(0xffffffff);
	Iw2DDrawRect(CIwFVec2(0,0), CIwFVec2(GAME_WIDTH, GAME_HEIGHT));
}