Exemple #1
0
void App::Draw() {
	SetProjection(fieldWidth, fieldHeight);

	SetTranslate(0, 0);
	progress.Draw();

	if (!progress.IsPaused()) {

		// background

		SetTranslate(0, 0);
		shaker.ApplyMatrix();

		drawTexture(texture, backPos, 0, 100, fieldHeight, 1.0f / 100, 1.0f);
		drawTexture(texture, backPos + 100, 0, 100, fieldHeight, 1.0f / 100, 1.0f);

		// debug data

		SetTranslate(25 - camPos, 0);
		shaker.ApplyMatrix();

		world.DrawDebugData();

		// platforms

		drawTexture(bottom,
					borderBodies[0]->GetPosition().x - 100,
					0,
					200,
					8,
					1.0f / fieldWidth * 3.0f,
					1.0f);
		drawTexture(top,
					borderBodies[1]->GetPosition().x - 100,
					fieldHeight - 13,
					200,
					13,
					1 / fieldWidth * 2.0f,
					1.0f);
		drawTexture(bottom,
					borderBodies[2]->GetPosition().x - 100,
					0,
					200,
					8,
					1.0f / fieldWidth * 3.0f,
					1.0f);
		drawTexture(top,
					borderBodies[3]->GetPosition().x - 100,
					fieldHeight - 13,
					200,
					13,
					1 / fieldWidth * 2.0f,
					1.0f);

		// creature

		drawCreature(playerBodiesPoints, b2Color(playerColorRState, playerColorGState, playerColorBState), 1, playerStatePoint);
		drawEyes(playerEyesBodiesPoints, playerBodiesPoints);

		// numbers

		SetTranslate(0, 0);
		shaker.ApplyMatrix();

		DrawNumber(false,
				   fieldWidth - 5.0f,
				   fieldHeight - 10.0f,
				   1,
				   1.5,
				   progress.GetLevel());
	}
}
Exemple #2
0
void Ski::draw(bool show) {
    if(show) drawSkeleton();
    else     drawCreature();    
}