Prev Next buttons with more than two objects?

0 favourites
  • 5 posts
From the Asset Store
Footsteps SFX Two contains 450 sounds of steps and jumps on different surfaces.
  • This is kinda hard to explain so I have included the capx below....

    dropbox.com/s/9nbrpfjdu96jwn3/jump.capx

    I'm trying to make a menu with three options (Map1, Map2, Map3) but I'm having some problems. Each "MapX" is a sprite image that you click to go to that map. I'm using a Previous Next button system to cycle through the map choices.

    With two objects (Map1, Map2) it's easy, but if I add a third (Map3) it jumps straight to the last option and bypasses Map2. I put a timer in as a test and it does indeed load Map2 then Map3, but a single click on the next button is starting both events.

    Am I doing this completely wrong? How can I get this to cycle through one step at a time? I've tried everything I can possibly think of and I'm out of ideas.   <img src="smileys/smiley11.gif" border="0" align="middle" />

    Thank you in advance for the help!

  • To clarify a bit, I have two Next buttons, Next #1 and Next #2. I'm not trying to run two events off of a singe object.

    1. When you click the Next button #1 it moves itself and Map1 out of the layout and puts Map2 and Next button #2 in their place.

    2. When you click the Next button #2 it loads the Map3 image, etc etc etc.

    Again, everything works fine with just two options, but if I add in a third it's like the single click is triggering both events.

    Here's some screens:

    The Layout

    dropbox.com/s/hm1t9b5inw16lj3/menuscreen1.jpg

    The Event Sheet

    dropbox.com/s/k1l2pmtc09a2afn/menuscreen2.jpg

  • The events are checked in order. When you click on mapSelect_nextMap2 then event 3 moves mapSelect_nextMap3 under the mouse, then event 4 runs and thinks you've clicked on that too. The easy way to fix it is to swap the order of events 3 and 4.

    A better way would be to have one sprite for mapSelect_map and one for mapSelect_nextMap and use instance variables to track the current and next maps.

  • A better way would be to have one sprite for mapSelect_map and one for mapSelect_nextMap and use instance variables to track the current and next maps.

    You mean make an instance variable on each map sprite defaulted to 0 and when that map is selected set the variable to 1, and then add an exception to only run if the map variable is 1?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I mean one map sprite where each map is a different frame. When you click on the next button it adds 1 to the frame and when you click previous it subtracts 1. You don't even need a variable, just use the frame number. When you click on the map sprite, go to a level based on it's current frame.

    mapSelect.capx

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