Archived

This topic is now archived and is closed to further replies.

Creating objects?

This topic is 5586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, this will probably seem a very stupid question in hindsight, but here it is: I''ve tried everything, and I can''t seem to get it to create a NEW (quad) object every time the user presses a key! This is really starting to piss me off, and I can''t seem to figure it out. I''m basically just trying to get a ship to shoot a laser (okay, so not basically - this IS what I''m trying to do), but I can only get it to do it once and I can''t seem to figure out how to make the darned thing shoot again. Like I said, this will probably seem extremely stupid, even to me in hindsight... but I''m stuck...

Share this post


Link to post
Share on other sites
your question is quite vague you need to specify more so that people can help you better??

the way im handling objects in my game is lets say you have a CPlayer class for your player or ship or whatever, then you would have a member variable of that class be CBullet *bullet (would be CLaser in your case), and then each time you press the key you just create a new bullet object bullet= new CBullet();

of course thats one of thousands of ways to handle such a thing

Share this post


Link to post
Share on other sites
i must''ve been on crack or something when I posted this question, because like I said, in hindsight, it was incredibly stupid.

What I do need to know, now, is how best to do some sort of time based movement for the bullet instead of a brute force loop that doesn''t allow anything else happen until its conditions of have been fulfilled.

Share this post


Link to post
Share on other sites