Infinite Platformer Help

For questions about using Classic.

Post » Sat Sep 15, 2012 8:12 pm

I feel kind of stupid asking this question, but how do you do this:

http://www.newgrounds.com/portal/view/571844

More specifically, how do you make it so the main character stays on the screen while everything else moves down or up or sideways AND without changing the layout size?

I tried using the platform behavior, but ever time my character bounces off an object, he get higher and higher until he leaves the screen.

I know in order to make it infinite you wouldn't want to change the layout size, but instead spawn enemies, obstetrical and items outside the layout and have them move in.

OR am I just thinking about this too hard?
B
3
Posts: 59
Reputation: 418

Post » Sat Sep 15, 2012 8:50 pm

If you measure how much the player moves then you can move everything, including the player, by the same amount in the opposite direction. Another way would be to make the layout unbounded and use the scrollto behavior on the player.
B
79
S
24
G
52
Posts: 4,723
Reputation: 39,709

Post » Sat Sep 15, 2012 10:07 pm

If I moved the player in the opposite direction by the amount measured, wont that just cancel them both out and then the end result would be 0 (meaning there would be nothing to measure or moving because nothing is changing)?
B
3
Posts: 59
Reputation: 418

Post » Sun Sep 16, 2012 8:26 pm

Tested it, and no it does not. Strange how that works.

Thanks for the help.
B
3
Posts: 59
Reputation: 418

Post » Mon Sep 17, 2012 3:35 pm

Right, the end result would be the player not moving at all but everything around him would move.

Here is an old cap that uses the method I described, but has a dead zone of no scrolling:
http://69.24.73.172/scirra/forum/viewtopic.php?f=8&t=4817
B
79
S
24
G
52
Posts: 4,723
Reputation: 39,709


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests