Mario-Style Camera

This forum is currently in read-only mode.
From the Asset Store
Slot Machine Games. suitable for workers who work from home because it has player names that must be played alternately
  • I'm trying to achieve a great camera for my 2D platformer and I'm using Mario games as my model of how it should work. It looks like it would be good to have the camera follow the player along X, but Y should only be scrolled if the player is jumping past a certain height on the screen, such as when you land on a platform close to the top of the screen or like in mario when you use a cape or something and fly way above the level. If Y scrolls all the time, it doesn't look very good and feels too jumpy with too much motion going on. This might be a little hard to explain, so I'll use a video and article:

    http://replicaisland.blogspot.com/2010/01/elusive-perfect-platformer-camera.html (this article has the video embedded as well if you want to go straight to this)

    I've tried all sorts of complex things involving the Advanced Camera Plugin. My most recent attempt was to try to use a "window" method like is mentioned in the linked article. In theory, when the player pushes up against a box around him, the window scrolls appropiately, otherwise it stays still. I did this by putting a Box at the top of the screen, (there would be one at the bottom as well) then using a couple cameras and camera switching and multiple layers with sprites and things, but it gets confusing and still won't work right.

    If anyone knows how to get this to work (a camera system like in SMB3 or SMW), it would be an amazing accomplishment and immensely appreciated.

  • Sounds like something useful I could add to the Advanced Camera plugin. I'll see if I can get around to that.

  • I was thinking of trying to implement something like this earlier in my game as I also didn't like it always scrolling... I failed miserably, so it's nice your considering to add it in your plugin Linkman!

  • sweet, Linkman!

    let us define a box within which there is no scrolling and the box that marks the maximum scroll speed, since some games might be off-center (think diablo with the inventory screen open).

  • That would be awesome!

    Then the player could move a few steps in a direction (or a lot) without scrolling, then when he runs into the side of the box, the camera moves to center on him. It could then keep him in the center of the screen the whole time he is running, then when he stops or changes direction, the box is reset with him in the center so he can take a few steps in a direction again before the camera moves. If it just scrolled as he pushed against the box edges without moving to center on him, he might not have enough field of view in the direction he was running.

    That would be one amazing camera for all sorts of games

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Done(for the most part).

    You can supply margins which dictate when the camera scrolls now, but the camera won't center on the object upon scrolling, and I'm not sure at this point if that will make it in.

    As it is, the code for this plugin is crap since I was still new to programming at the time. Adding a feature like that just adds more complexity to an already unstable mess. I'll see what can be done, though.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)