Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Scene::renderHPBar() {
- // koniec gry, brak zdrowia
- if (Player::HP <= Player::minHP) {
- //gameOver = true;
- }
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- gluOrtho2D(0, 100, 0, 100);
- glDisable(GL_LIGHTING);
- glDisable(GL_CULL_FACE);
- glBegin(GL_QUADS);
- glColor3f(1, 0, 0);
- glVertex2f(2, 97);
- glVertex2f(2, 95);
- glVertex2f(2 + 30 * (Player::HP / Player::maxHP), 95);
- glVertex2f(2 + 30 * (Player::HP / Player::maxHP), 97);
- glColor3f(0, 0, 0);
- glVertex2f(2 + 30 * (Player::HP / Player::maxHP), 97);
- glVertex2f(2 + 30 * (Player::HP / Player::maxHP), 95);
- glVertex2f(32, 95);
- glVertex2f(32, 97);
- /*
- glColor3f(0, 0.3, 0);
- glVertex2f(1, 98);
- glVertex2f(1, 94);
- glVertex2f(33, 94);
- glVertex2f(33, 98);
- */
- glEnd();
- glEnable(GL_LIGHTING);
- glEnable(GL_CULL_FACE);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- }
Advertisement
Add Comment
Please, Sign In to add comment