# How do I make slide effect?

0 favourites
• 11 posts
From the Asset Store
3 different games for kids, easy to edit, mobile ready
• Hi,

I would like to make a slide effect to a mobile game. It's not a just regular slide, this includes sliding an object in a bit angular way. Please check the below image to get an idea.

https://www.dropbox.com/s/4b1qjifdtf981xt/Theme%20Screen-01-small.png?dl=0

In this image, I would like to make the planets slide to the 1st planet's position when swiped to right and slide back to their respective positions when swiped left. Planets are not in straight path, they are in an angular way. Does anyone have an idea on this?

Thanks.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• From the image, I am assuming you wanna the planets to be rotate around in circular like Rotary Dial telephone.

One possibility is to use this math formula:

Once you understand what these formulae do, you could extend it with for loop to loop through your planet and move these planets in circular motion.

Do you follow?

• TwinBlazar OMG, I never though I could use geometry for my games . Could please tell me more elaborately on making it happen. Thanks.

• I'll give you a little hint: First, just create one object, give it variable centerx = 300, centery = 300, radiusx = 100, radiusy = 30, angle = 0

every tick for the object, do this:

set angle = object.angle + 360*dt

set x = object.centerx + object.radiusx*cos(object.angle)

set y = object.centery + object.radiusy*sin(object.angle)

Now, run it and you should see the object spinning around in oval manner centered at 300,300. Now, imagine for loop for many objects... does that ring any bell?

• TwinBlazar I tired your suggestion it is working great, thanks but this is not what I require. I wanna make the planets slide to another planet's position when swiped left or right. May be I didn't make it clear on the first place. If you see the image, those planets consists of 40 levels each. When the user clicked on of them, the user will be lead to level selection screen for a particular planet. Now, while selecting planets, I wanna make slide effect. For example, if I wanna select the second planet I will have to swipe to right, so when I swipe on the screen to right, the second planet has to slide over to the first planet's place and the first planet should go out of the screen. Likewise, when the second planet takes the first planet's place, all the other planets to should come forward to other planet's place.

Similarly, the exact opposite should happen when swiped to left. Did I make it clear? If not please let me know, I tell you more detailed.

Thanks.

• In that case, maybe you wanna try this? https://www.scirra.com/tutorials/756/se ... -waypoints

And then manipulate these planets' positions based on the waypoints.

• TwinBlazar I used lerp expression instead. It is working great. You can check it in the below link. Thank you so much for your time.

https://dl.dropboxusercontent.com/u/87665007/The%20Space%20Traveller/index.html

• Congrats! That looks cool!

• TwinBlazar Thanks.

• Thank

• Hi. I'm here to learn it! I can doahomework.com help with assignment writing but not but here I'm not an expert!

• 11 posts