Really? That sounds really good, do you have a code snippet that shows how you did that?
-IV
Small issue...
Just keep it simple:
Bullet bullets[100];
This gives you 100 bullets. Just put a flag in the bullet class that says whether a bullet is active or not. To delete a bullet, set it's active flag to false. To add a bullet, find an inactive one, set it's active flag to true and pop in your data.
Mike C.
http://www.coolgroups.com/zoomer/
Bullet bullets[100];
This gives you 100 bullets. Just put a flag in the bullet class that says whether a bullet is active or not. To delete a bullet, set it's active flag to false. To add a bullet, find an inactive one, set it's active flag to true and pop in your data.
Mike C.
http://www.coolgroups.com/zoomer/
I have been working on a 3D shooter and i had this problem. The way i solved it was within the CObject class which i set up for all the game objects i tested for a collision with other objects including a bullet.
it was something like:
if(_pbsphere->TestCollision(this->_pgame->GetBullet()->GetBounding Sphere()))
{
this->_pbullet->SetPosition(100, 0, 0);
//this moves the bullet of screen
}
and within the CBullet class whenever i pressed the shoot button i would move it back to the centre of the camera with its set direction and velocity. Quite easy really!
Spencer
it was something like:
if(_pbsphere->TestCollision(this->_pgame->GetBullet()->GetBounding Sphere()))
{
this->_pbullet->SetPosition(100, 0, 0);
//this moves the bullet of screen
}
and within the CBullet class whenever i pressed the shoot button i would move it back to the centre of the camera with its set direction and velocity. Quite easy really!
Spencer
not exactly what asked about but in my game lazers etc are treated as particle systems + not as a special object sort,
all PSs instances are created at game startup
each PS has a uniqueID each spaceshipo has a uniqueID, its very easy to send messages between the two (and not worry if one doesnt exist anymore)
all PSs instances are created at game startup
each PS has a uniqueID each spaceshipo has a uniqueID, its very easy to send messages between the two (and not worry if one doesnt exist anymore)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement