void drawMyCircle(int x, int y, float radius) {
  ofSetColor(0,0,0);
  ofNoFill();
  ofCircle(x, y, radius);
  if(radius > 2) {
    radius *= 0.75f;
    // The drawCircle() function is calling itself recursively.
    drawMyCircle(x, y, radius);
  }
}
예제 #2
0
void soldier::draw() const
{
    // Draw health bars
    glColor3d(1.0d, 0.66d, 0.0d);
        glVertex2d(m_pos.x(), m_pos.y());
        glVertex2d(m_pos.x() + 20.0d * m_health, m_pos.y());
        glVertex2d(m_pos.x() + 20.0d * m_health, m_pos.y() + 4.0d);
        glVertex2d(m_pos.x(), m_pos.y() + 4.0d);
    glEnd();

    glColor3d(0.8d, 0.8d, 0.8d);
    glBegin(GL_LINE_LOOP);
        glVertex2d(m_pos.x(), m_pos.y());
        glVertex2d(m_pos.x() + 20.0d, m_pos.y());
        glVertex2d(m_pos.x() + 20.0d, m_pos.y() + 4.0d);
        glVertex2d(m_pos.x(), m_pos.y() + 4.0d);
    glEnd();

    //TODO:
    glColor3d(1.0d, 0.0d, 0.0d);
    drawMyCircle(5.0d, m_pos.x(), m_pos.y());
}
예제 #3
0
void spawnpoint::draw()
{
    drawMyCircle(SIZE, pos.x(), pos.y());
}