Friday, July 6, 2012

Day 9 - The Camera

I got the camera working today. To do this I needed to add everything on screen to a new class I called World. The camera camera class takes an object to follow (in my case Mario) and moves across the world as Mario moves. I had some issues with the collision detection going bonkers after I implemented it, but soon figured out that my algorithm to find solid tiles on the screen was messed up with the addition of the camera. With everything sorted out, I built the rest of level 1-1 so Mario can run though it!

Today I learned the limitations of my tile manager class because I'm having trouble spawning objects like mushrooms and stars from blocks when they are hit. Each block needs to be able to spawn a new game object... To top it off, when I create an entire level my framerate drops from 6000 to 1500. It gives me new respect for the programmers that did this on hardware over 25 years ago.

 My code is currently torn apart and unplayable at the moment, but here's a video from earlier today.


No comments:

Post a Comment