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
56
S
15
G
13
Posts: 825
Reputation: 17,643

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)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

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
43
S
22
G
20
Posts: 735
Reputation: 11,977


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests