Welcome!

Hey, I'm Skylar, a kid aspiring to become a competent programmer. This blog is here to detail my dabbles in development.

My dream is to one day become a professional programmer and do some game development in my spare time.

Thanks for visiting my blog, and I hope you'll come back!

Pages

Day 4 of Charge Development

I know there's a day that's not counted for. I didn't get anything done yesterday, so I hauled butt today.

So the game actually compiles and works except for one collision glitch. Sometimes the bullets don't kill the enemy... it's weird.

Anyways so what I've gotten done since I started rewriting the code two days ago. I've almost finished the rewrite. It's in a compilable form, but there's still a few touch ups to be made, including fixing that collision glitch. Its real late, and I haven't the slightest clue of where the glitch is coming from, otherwise I'd fix it now. The only 'new' feature, is that the player can shoot up to 5 bullets now, and there are now 5 enemies in my testing level.

I made some nice hierarchies, but I think the inheritance needs some work. The biggest problems I had on this rewrite all seemed to do with inheritance. The first errors I was getting were because I was trying to directly access private data in the base class from a derived class. I decided it would be best to use protected data instead of private in these cases. It's like the best of both public and private. You get the data encapsulation of private member data, while being able to directly access them in a hierarchy. The second thing that really got on my nerves was the bass class not having the functions that the derived classes have.

A great use of inheritance is how you can use a pointer to generalize. So if I wanted to create 5 enemies, but didn't know what type of enemies, I could make an array of pointers like:

Enemy* enemy[5];

So after I declare that, I can store any type of enemy in there as long as the enemy inherits from the Enemy class. That's exactly what I did, but when I needed to call some functions in it, like when deleting the bullets, I'd call a destroy_bullet() method, but destroy_bullet() isn't in the class Enemy. This caused me to use a lot of pure virtual functions.

The first bit of research I want to get done, is to find a better way to control enemies with their projectiles and players with their projectiles. I want a way so I'm not stuffing base classes with pure virtual functions.

Once I get this stuff figured out the next thing I'm going to add is quad tree decomposition... otherwise known as the section system! Once all that is done, and I'm satisfied with it, we'll move on to the fun stuff, AI and new types of projectiles =D.

Well that's the update for yesterday, technically, so I'll try to post another tonight.

0 Response to "Day 4 of Charge Development"

Post a Comment