1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
class Bullet
{
bool Friendly;
private:
double x,y,prevx,prevy,speed,direction;
public:
void Draw_Bullet ();
void Move_Bullet ();
Bullet(double,double,double);
};
Bullet::Bullet(double ax, double ay, double adirection)
{
x = ax;
y = ay;
direction = adirection;
}
void Bullet::Draw_Bullet ()
{
glBegin(GL_LINES);
glColor4f(1,1,1,1);
glVertex2f(x,y);
glColor4f(1,1,0.9,0);
glVertex2f(prevy,prevy);
glEnd();
}
void Bullet::Move_Bullet ()
{
x += cos(direction) * speed;
y += sin(direction) * speed;
}
vector<Bullet> Player_Bullets_Vector;
|