Ok, so maybe it does look like an astronaut standing on a hill of chocolate chip cookies[grin]
So yeah, this is my new game project. This screenshot doesn't show off the coolest part of the game yet, animation. That's right, the player sprite is now almost completely animated (except for a jumping frame).
I did come across an interesting bug when writing the animation code, though.
See, to animate my player character, I first created a multi-dimensional array of bitmaps to hold the sprites:
MAX_FRAME = 3, by the way.
The first dimension holds the sprites for each direction the player might be facing, which for this game is only right and left. The second dimension holds the max amount of sprite frames in the animation.
Now there was my animation code:
if(m_FrameCount >= m_FrameDelay)
if(m_CurFrame >= MAX_FRAME)
m_CurFrame = 0;
m_FrameCount = 0;
When I ran the program the animation would spin when the player ran right and flicker when it ran left. I thought this was really odd, and it took me quite awhile to find the problem.
Turns out I was trying to access an index pass the bounds of the array. I quickly fixed the problem and now it looks great. However, I would've expected a bug like this to crash the program with an access violation, but it didn't even crash it in the debugger. Does VC++ perform some sort of bounds checking or something like that? that is the only thing I can think of.
Also, does anyone know how to make a SDL program wait for V-Sync? I'm trying to make the scrolling on the game smoother.
Anyways, I'll keep working at it, but it is coming along very nicely so far.