• interested in more? sign up to the newsletter


Project Outlands: movement

Tweet about this on TwitterShare on RedditShare on Facebook

Decided the best place to start was creating the player movement and background scroller. I cheated a bit here, cause I copied a large part of code from my INC game (since I think this game will be an extension on that universe)  but I wanted better movement so added fixed-point math to make the player move a lot smoother around the screen.

For now I’m going with a single 480×160 pixel bitmap as background, no tiles or anything, just a collision map defining the solids (floors, walls, etc).  Added advantage: very fast rendering, and possible to add better variation and detail to the background. 480×160 in this retro mode means about two screens wide and one screen high on mobile phones.  Very small, but since I want this to be a chaotic shooter, it should work perfectly

The scroller comes with a little delay, so you can run away from the camera, but since the game area is so small you will never be able to really outrun it. Even cooler, all it takes to make this scroller is this line:

worldOffset+=  ((myPlayer.x-128)-worldOffset)>>2;

And substracting the worldOffset variable from all your rendering makes things appear at the right spot with the player centered!


Bookmark the permalink.
  • You’re saying you can run away from the camera. Seeing as the game is a platform shooter, wouldn’t it be handy if the camera would move more in front of you in the direction you’re running so you can see where you’re going and what you can shoot? In the style of a kind of racing game camera where it gives you more view the faster the go. :3

  • admin

    It’s certainly worth a try to see how that plays.

    Right now it’s not like you get really far ahead of the camera, it’s more a very little inertia that the camera has when tracking you; the difference in what you see is maybe 8-16 pixels.

    Will look in the other option of having it infront of you