How do I make a simple sliding menu/carousel?

0 favourites
  • 3 posts
From the Asset Store
Carousel Animation, make carousel of you image gallery or anything
  • I'd like to make a horizontal list of sprites that you can move left/right to choose a level...

    I made some thumbnails from a single sprite entity, using different animation frames for each thumbnail (to keep the sprite count down).

    I arranged them in a line, then added a MoveTo on the touch-object action (touching left button moves them all left 100px etc).

    However if I rapid-fire the left-right button they move more than they should, and don't align in the centre.

    I'm guessing there's a better way to move the sprites left/right a set amount so you always end up with one in the centre?

    I'd be grateful for any tips on making a carousel type menu. They don't need to loop back to the start if easier?

  • Two simple ways that you might be able to fix what you already have:

    1. Add a check so that the left/right buttons only work when the sprites are NOT already moving.

    2. Add a cooldown timer to limit how often the user can press the buttons. Eg

    variable menuCoolDown = 0 at start

    if user clicks left / right & menuCoolDown != 1: Do the sprite move, set menuCoolDown to 1, wait 1 second, set menuCoolDown to 0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you... the 'NOT already moving' command is a great solution.

    I wonder whether combining them into one large/wide sprite would be more efficient than lots of sprite entities being moved at once?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)