Advertisement

Shooting Effect

Started by November 15, 2000 05:26 PM
0 comments, last by Bezzant 24 years ago
I have made the base of a small game where the ship flies about the screen and that.... but I don''t know how to make the draw a pixel on the screen that will act as a bullet taking a guess I would say it is glDrawPixel or something like that but am not sure, so could someone help me please I already have a method that will give me the co-ordinates of where it will start I just need to know how to draw a pixel... I can easily move the pixel up the screen like a bullet Also how would I change the bitmap that is loaded as the ship by the press of a key? Many Thanks Alan IF YA SMELL... WHAT THE BEZZ IS COOKIN''''
In regards to your first question, you could probably use

glBegin(GL_POINTS);
glVertex3f(x, y, z); //Put your points here
glEnd();

And in regards to the second question you could have an int that would specify which texture to use and change that int whenever the correct key is pushed. For Example...

int shipimage=0;
.
.
.
DrawGLScene()
{
// Drawing Code
glBindTexture(GL_TEXTURE_2D, texture[shipimage]);
//Draw Ship
// More Drawing code
}
.
.
.
//Winmain keyboard code
if (keys[yourkey])
{
shipimage=!shipimage;
}

This will rotate between two ship images where they are texture[0] and texture[1]



Open mouth, insert foot

Edited by - oglman on November 15, 2000 8:33:12 PM

This topic is closed to new replies.

Advertisement