Well I finally started working on Lazteroids 2. I've actually been working on it for the past 3 weeks or so, but lately, whenever I start up my compilter, I just stare at my code and get nothing done.
I've come to a few realizations. Whenever I get to a hurdle I have to jump, I can't. I just freeze and stare at code. What is the hurdle this time? It's mainly design and structure. That's all it usually is. I don't really have a problem coding this stuff, it's just he design. Here's a "for instance"...
The game is going to have a player ship, three types of UFOs, and blow-upable asteroids. I already have my CObject base class written, but now the problem is, how do I put the rest of the stuff in? what kind of classes do I use? How do I set them up? I have a few options. Here's is one way:
CPlayer : CObject
CUFO : CObject
That seems like the logical solution, I think, since each one needs to be handled differently. But I could also do:
CShip : CObject
CAsteroid : CObject
By doing this, I could define both UFOs and Players as a CShip, and just set a type variable. Or....
CPlayer : CObject
CBaddie : CObject
This is similar to the situation above. Set a type in the CBaddie for the TYPE of baddie (one of three UFOs or an asteroid). Problem here is, asteroid destruction needs to be handled differently than UFO destruction.
As I said, I will probably go with the first, as it would be easier to work with in the long run, and a bit more robust maybe? (Is that the right word, robust?). Who knows, I'll try it.
Part of my problem, also, is trying to convince myself that there is no wrong way to do something. If it works, then I did it the right way. It might not be the optimal way, or the cleanest way, but that doesn't make it wrong. I know that, I just have trouble convincing myself that.
So that's where I stand on Lazteroids 2. I even managed to write a reusable input wrapper. Go me.