Thursday, August 30, 2012

Day 13 - Back in Action

I had a mostly free day at work so I finally was able to sit down and get back into the swing of things. I've been super busy at school planning lessons and having classes (5 per day!) while HAJET web development has taken up most of my free time at home.

I got a surprising amount of work done on the game today. The code just fell into place with no errors or extra fiddling required. I fixed the issue I had with the mushroom spawning by adding a flag to stop collision detection. The mushroom was trying to pop out of the box, but my collision detection algorithm said "No!" and prevented it from moving. Once finished I added the powerup to Mario. He now turns into big Mario when colliding with the mushroom!

Next I implemented the fireflower powerup and everything that goes along with it. Getting it to pop out of the item box was easy; It's the same as the mushroom. Transforming Mario into fire Mario was also a simple change. Finally, implementing the fireball took some time. It's still not quite right because Mario can shoot an unlimited number of fireballs regardless of how many are on screen. I'll fix it later.

Last, I added my first enemy, a goomba! He slowly walks across the ground, bouncing off walls, falling off blocks, and dying when Mario jumps on or shoots him. I've got a feeling that implementing the other enemies will be quick and painless too!

I have a few things to clean up in my code. I'm not looking forward to fixing this stuff because I know it will take a lot of time and it's not fun.

  1. Add an enemy manager. This will spawn the enemies when Mario gets close and remove them when they are too far outside the view-able screen.
  2. Revise the tile manager. Currently it loads all the tiles into memory at once. Only the tiles on screen and a few rows off screen should be loaded at one time. The game should be running around 6000fps, but it's only running at 1500fps because of this.
  3. Fix the game object class. Not all game objects have sprites associated with them, some have animations instead.
Here's the video!


No comments:

Post a Comment