Custom scrolling like Mario

Get help using Construct 2

Post » Tue Jul 31, 2012 3:39 pm

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?
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Tue Jul 31, 2012 4:22 pm

I assume you mean the classic NES mario?

If so, here's a way:
MarioScrolling.capx (r99)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 31, 2012 4:38 pm

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 :)

B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Tue Jul 31, 2012 4:50 pm

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.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 31, 2012 4:56 pm

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!
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Tue Jul 31, 2012 5:02 pm

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).Nimtrix2012-07-31 17:03:53
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 31, 2012 5:12 pm

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 :)
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Tue Jul 31, 2012 5:35 pm

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)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 31, 2012 5:43 pm

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!
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Tue Jul 31, 2012 6:18 pm

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?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Next

Return to How do I....?

Who is online

Users browsing this forum: GSquadron, HTB and 27 guests