I am working on a asteroids game. I am able to move the spaceship up and down and left and right. I just want it to shoot bullets using the space bar.
here is the code for the shooting bullets function.
void bullet()
{
glPointSize(2.0f);
glBegin(GL_POINTS);
glVertex3f(0.0f,up,0.0f);
glEnd();
up+=0.1f;
if(up >= 10.0f)
{
up=0.5f;
}
}