June 17th, 2011
I’ve completed a fairly decent amount of the game engine at this point, despite numerous setbacks. I spent almost an entire day trying to come up with a way to rotate a rectangular bitmap around a point without it taking a couple years to render before I realized that the game library I’m using has a function that does just that. Many times I had something working fine, and then something else I’d implement would require me to go back and completely redo the original piece of code. Not to mention the physical setback when I managed to hurt myself pretty badly on a stairwell; I ended up with a pretty decent head injury that required some stitches, painkillers, and most of a day of bedrest. As for coding, this is what I have so far:
Auto-scrolling, WASD movement in addition to arrow keys, an enemy interpreter that works with melee and ranged enemies with unique behaviors, a projectile interpreter that works with both player-originated and enemy-originated projectiles, a completely finished collision detection including ramps (also applicable to enemy movement). I also spent some time compartmentalizing a lot of my code into functions and subroutines that are a lot easier to modify than what I had before. I know the next-most-efficient thing would be to create classes for some of the objects I’m simply using arrays for right now, but I’m not as comfortable creating classes in Python as I was in C++. Besides, my arrays work pretty well; the only real advantage would be readability for anyone who would be modifying my code after me. And since I don’t intend to let anyone else take a crack at it, readability isn’t a concern of mine.
The only ongoing bug is the fact that projectiles actually display their sprite twice per frame, which will get fixed as soon as I implement sprite animation, which unfortunately needs to happen next. I know I had weapons next on the list, but the longer I put off animations, the more convoluted and bastardized my coding is going to become. It’s already going to require a bit of a redesign to get things working the way I want them to in the first place; I can’t afford to have too much more to change. I just need to suck it up and make it happen; I already have a good idea of some methods to try out.