コード例 #1
0
ファイル: CPlayer.cpp プロジェクト: richo/SSVOpenHexagon
	void CPlayer::draw()
	{
		drawPivot();
		if(dead && !hexagonGame.getStatus().drawing3D) drawDeathEffect();

		Color colorMain{!dead || hexagonGame.getStatus().drawing3D ? hexagonGame.getColorMain() : getColorFromHue(hue / 255.0f)};

		pLeft = getOrbitFromDegrees(pos, angle - 100, size + 3);
		pRight = getOrbitFromDegrees(pos, angle + 100, size + 3);

		vertices[0].position = getOrbitFromDegrees(pos, angle, size);
		vertices[1].position = pLeft;
		vertices[2].position = pRight;

		for(int i{0}; i < 3; ++i) vertices[i].color = colorMain;

		hexagonGame.render(vertices);
	}
コード例 #2
0
ファイル: CPlayer.cpp プロジェクト: TheKK/SSVOpenHexagon
	void CPlayer::draw()
	{
		drawPivot();
		const auto& isDrawing3D(hexagonGame.getStatus().drawing3D);

		if(!isDrawing3D && deadEffectTimer.isRunning()) drawDeathEffect();

		Color colorMain{!dead || isDrawing3D ? hexagonGame.getColorMain() : getColorFromHue(hue / 255.f)};

		pLeft = getOrbitFromDegrees(pos, angle - 100, size + 3);
		pRight = getOrbitFromDegrees(pos, angle + 100, size + 3);

		vertices[0].position = getOrbitFromDegrees(pos, angle, size);
		vertices[1].position = pLeft;
		vertices[2].position = pRight;

		if(!swapTimer.isRunning() && !isDrawing3D) colorMain = getColorFromHue((swapBlinkTimer.getCurrent() * 15) / 255.f);
		for(int i{0}; i < 3; ++i) vertices[i].color = colorMain;

		hexagonGame.render(vertices);
	}