Custom scrolling like Mario

0 favourites
  • 14 posts
From the Asset Store
Classic style beat'em up template. Punch & Kick foes across the screen.
  • I have been playing around with different scrolling all day but still can't work out how to do Mario style scrolling. I have been using another invisible object as the camera but am finding hard to control in a useful way. Basically I want the camera to move so he can see further ahead but also have a dead spot in the middle where it doesn't scroll.

    Anyone have any suggestions?

  • I assume you mean the classic NES mario?

    If so, here's a way:

    MarioScrolling.capx (r99)

  • Thats got some great bits in that, thank Nimtrix!

    But it needs to be so you can see more in front and less behind and then do the opposite when turning around.

    Any more help would be greatly appreciated :)

  • You said you wanted a "dead spot" in the middle? I don't see how that would work if you also want the camera to be in front of the character and flip if he turns.

  • Yeah that is where I am stuck. Originally I thought about having invisible objects acting as scrollable areas around the character but the character wont interact with them on a none scrolling layer even though when I set them to visible, they are clearly there.

    It's cool working this one out though as I have discovered other methods of scrolling.

    One thing Nimtrix, I don't understand this "lerp" command, can you roughly explain it to me.

    Thanks again!

  • I'm not saying it can't be done, I'm just saying I have no idea what you mean. If the camera is in front of the player no matter what direction he is facing, the player will never be in the middle. So where is this "dead spot" supposed to be?

    Check the FAQ for explanations of linear interpolation (lerp).

  • I just tested Super Mario World and what happens is Mario gets slightly past the centre horizontally and then the camera over takes Mario so the screen shows more in front than behind. When he turns around the screen stays static but when he reaches a certain point walking the other way the camera then scrolls again to show more in the other direction.

    This is a good challenge :)

  • Alright, looked at Super Mario World now. There are a huge amount of mario games, so I assumed you ment the first one. (doesn't scroll back if I remember correctly)

    Anyway, how's this?

    MarioWorldScrolling.capx (r99)

  • Thats a really clever way of scrolling. Nice one! Good dead spot.

    It's almost like you want to invert the horizontal position so it stays behind him. The main reason why I want to do it this way is because my characters are quite large and I really need the player to be able to see ahead so they don't die because they can't see enough ahead.

    Really appreciate the help Nimtrix!

  • Always happy to help! But I forgot all about the "looking forward" thing, sorry. It's a bit tricky, but here's one solution at least:

    MarioWorldScrolling2.capx (r99)

    Camera's a bit jumpy if you run back and forth a lot, but maybe it's good enough?

  • Ha that's getting very close! Really impressed.

    I'll try and have a play with that method too, I am sure others will find this information useful too.

    I roughly understand what is going on but it might take me a while to get it to the point I can modify it. If I can improve on it I will upload.

    Thank you again!

  • very useful thanks it is abit to jumpy im gona try n fix that were do you suggest to start with that cuz its good but its gotta be perfect maby i already tried tweaking the deadzone and scroll speed still jumpy what you thinking?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hey found qa different thread it helped me i think this is what you might be looking for

    http://www.scirra.com/forum/solved-manage-scroll-behavior-metal-slug-like_topic45395.html

  • Hey, thanks for that link! I will give that a go. I have got a pretty decent camera using 2 invisible objects, one as the camera that scrolls to the other object which is set to two different positions depending on whether the characters mirrored or not. Its nearly perfect, just a very slight jolt at the end if you look really hard!

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