How do I make sidescrolling parallax

Just started using Construct 2? Post your questions here

Post » Mon May 04, 2015 11:24 pm

Hello,
I'm new to C2 and gave myself the challenge of building a platformer before buying a license.
So here is my doubt:
I have 4 layers (can't add more unfortunately :cry: ) : Background (blue sky + mountains), HillsBack, HillsFront and Main(for the objects,platform,etc)
I'd like to know how to make the game side scroll, so far I've manage to side scroll only the sky. But at the same time I'd like to maintain a parallax effect . I can do both separately but not at the same time. Here's a picture to illustrate:
prntscr. com/71m8m4 (without space)
Also to avoid a future post, can I build my game freely and export it to ios (once I have a license) without worrying with compatibility,resolution issues,etc?
Cheers
B
3
Posts: 2
Reputation: 179

Post » Mon May 04, 2015 11:52 pm

infinite scrolling with parallax you need to do a calculation to compensate for the scroll speed being different. then you you need to move it to the nearest multiple of 512 (assuming your tile is 512).
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Tue May 05, 2015 12:01 am

here's a thread where I mostly talk to myself.. I don't think any was understanding what I wanted to do...

math-help-lerp-to-compensate-for-parallax_t129806?start=10

but you are probably not using an unbound layout, but still you will need the calculation for scrolling parallax.

also set in On Start of Layout: Layout Scale to 0.25...it really helps to see what is happening when you run it...
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Tue May 05, 2015 1:27 am

Thanks for the quick answer. But wow it's waye more complicated than I thought :shock:
I took a look at your .capx but it's no quite that as my game is a platformer (If you ever played mr jump for ios/android, that is the result I'm aiming for).

jobel wrote:then you you need to move it to the nearest multiple of 512 (assuming your tile is 512).


Can you explain this part please? :?

Thanks
B
3
Posts: 2
Reputation: 179

Post » Tue May 05, 2015 3:26 am

sorry I was assuming you were using tiled backgrounds...

it all depends on how you set it up. i.e. if your player is moving past the background, opposed to having the background move past the player simulating player movement.
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Wed May 13, 2015 7:08 am

set layout to 0,0
B
9
S
2
Posts: 40
Reputation: 673



Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests