Friday 5 November 2010

Scrolling gameview

One of the new features in Teemu. In order to get it work I had to separate the Display-functions from level coordinates and give them absolute screen coordinates. Level::Show is refactored heavily and it's almost ready. I think I need to link the offset checking routine into movement of player and not inside Level::Show, but I'm not sure if there is any speed gained since the offset check is going to affect moving speed anyway. I made the view follow the player's coordinates so it's scrolling each time you move, but I'm going to change that to push scroll type. It's harder to do, but better than continuous scrolling. The main issue with push scroll is the area not visible to player, but reachable by throwing item. The visibility check must include the area left outside the current gameview.

I have already made a support for variable size levels and tried both smaller and bigger than the default size. I guess most levels are going to scale to bigger sizes well, but smaller sizes could need some adjusting. It's nice that the default size for level is gone and there can be different size levels.

No comments: