How do I move my character between levels on a world map?

0 favourites
  • 7 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • This thread is sort of a sequel to a previous thread I made:

    viewtopic.php?f=147&t=122741&p=874659

    You might want to read that one first, it's only like 3 posts long. I'm having another, separate but similar problem to that one. I previously used the LiteTween plugin to move my map character between map squares on the grid (Mario Bros. 3 style) and it worked well because each button was a separate object that I could point it to move towards, like so:

    But I don't know how to make this work with the new system made using the previous thread's solution where the level button is just one object with different instances. Any ideas? Is there a way to, say, point the character object toward the level button that has "atlevel=2" as its value and so on?

  • Just double posting to say that I was messing around with it while waiting for a response and I found a solution by modifying my code as such:

    I couldn't figure out how to get it to pick the level button by the variable, so instead I used Pick by UID to select the specific button I want the sprite to move to. Then I do my LiteTween function as before and it moves toward the button.

    If anyone has a better solution I would love to hear it, but this is what I've found works for now.

  • IMO you shouldn't use UID. Just have an ID value of your own in each button (say, the corresponding level number) and use that in your picking (i.e. levelButton: ID = atLevel)

    edit: as described in other thread?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't know how to use it for my picking. I did say I was unable to figure it out in my above post.

  • I don't know how to use it for my picking. I did say I was unable to figure it out in my above post.

    I gave you the code

    Instead of

    [quote:2qpjyvzr]levelButton | Pick instance with UID 140

    use

    [quote:2qpjyvzr]levelButton | myLevel = atLevel

    I changed 'ID' from previous post to 'myLevel'

    edit: if you feel like posting your capx I can have a look

  • Ah, okay, I've got it now. I didn't know you could just do a 'compare variable' condition in that situation! Thank you for the help!

  • Ah, okay, I've got it now. I didn't know you could just do a 'compare variable' condition in that situation! Thank you for the help!

    no worries, good luck

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