How to? Slider Effect

Get help using Construct 2

Post » Mon Apr 29, 2013 7:36 am

Hey everyone! I have a layout with 20 levels to select from. I want to add a Left and Right arrow so that a player can view the next 20 levels. I don't want to change the Layout though. Is there a way I can have 20 sprites slide in at once? Hope I explained myself clearly.

Here's a photo of what I mean.

B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Mon Apr 29, 2013 6:04 pm

not sure my solution is the best, but:

You set your Background layer parallax to (0, 0)
You createanother layer for your button's levels, with a parallax of (100, 0), to make this layer scroll on the X axis
and You use the scrolling to make it scroll (a ScrollTo behaviour on a sprite maybe, and you move the sprite when necessary)
https://www.scirra.com/forum/viewtopic.php?t=152506

And that is why you shall respect the bug reports guidelines, not only giving a capx is making the bug reproductible in one click in a situation they can work with (less time wasted trying to reproduce vague instructions) but also it helps filtering false positives.

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
42
S
17
G
16
Posts: 2,090
Reputation: 15,347

Post » Mon Apr 29, 2013 7:16 pm

Theres the easy tween behaviour, or you could lerp it.

put sprites into a family.

if left arrow pressed and variable = stop, set family variable "target_pos" to self.x - what ever, set variable to left.

if variable = left,
sub event
distance to "target_pos" > 1, set family.sprites x pos to lerp(self.x, "target_pos", dt*speed)
distance to "target_pos" <= to 1 set variable to stop.
B
37
S
19
G
18
Posts: 613
Reputation: 10,231


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests