Since my last rather strange (looking back now) post, I thought I would share with you something a little more normal. Like what my game is currently looking like. Bare in mind I scrapped what I had of the time of my last post (which is near enough what I have now) and re-wrote all of the code. Since starting again I have actually learnt how to use extern correctly! God knows what I was doing without it before! Things seem a lot tidier now that I don't have to pass pointers through functions all the time. Don't get me wrong I'm not "externing" everything, in fact only my special console class and the keyboard\mouse class's. The console is actually a drop down box which displays text, which any class I feel needs to can write to it. This is mainly for debugging purposes while the game is running. It also saves a nice text file when the program closes in case anyone wishes to see what was happening.
Apart from that amazing discovery, I've managed to get a nice little sprite class going. Below is a brief video of some of the stuff it supports thus far.
To make the game I'm using C++ and Allegro. You can find links on the right if you wish to find out more about both. But as you can see I'm taking full advantage of Allegro's drawing routines to have maximum flexibility with my sprites (it looks jerky because cam studio is only capturing frames every 5ms). So far my sprites support scaling, rotation and flipping as far as image manipulation goes, and also animation.
I'm quite happy with the way the animation is working out so far, but you might have seen it still has a few bugs (the green square!). The way the maximum frames and number of animations is worked out is actually pretty sweet, once the bugs are ironed out I think I will write a tutorial on it.
Also another revelation this time round (I mean me programming again, I usually have around a 2 year gap) is the way my game states are handled. Someone posted a link to a tutorial on A.cc forums, which lead me to this tutorial. I mucked about with the code a bit and shoved it into my "engine" and so far it's working like a dream. I'm a sucker for keeping things organised and I believe this approach is perfect for it.
Well I think that's enough for today, until next time.
Thursday, February 18, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment