0 Favourites

How do I use functions to travel through Mario pipes

  • Hey there, guys. I was just wondering if anybody had any advice on how to use functions to move through pipes in a Super Mario Bros. remake I'm doing. Right now, I just have to code each individual pipe to move me to another location. This is very inefficient, however, as I believe I could just use a function event one time and it work with every pipe. All the pipes just take me to one location, though. Please help, thank you

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Give the pipe a variable and use the variable in the function to decide where to go..

  • The animation would always be the same, so that's what you want. And I would use the same pipe graphic, and pick by Unique ID in the code to decide where to go.

    Like LittleStain said, use a function to run the animation process, then separately call for the UID to tell which layout/area to go to. This way, you don't always have to go to another layout (like Mario 3's higher/lower areas for verticle levels).

    Bottom line, it takes quite a bit anyways, but you can shorten the code by giving similar things such as the animation procedure as always the same regardless of which one it is, but each one does have to find a method of knowing where to bring the player.

    Below is how I do it for warping in my Zelda 2 clone. Because there are no animations, but I use the same "event" graphic, I have to pick by UID to determine which graphic is actually being activated.

  • wow, thank you so much for the quick response, it was very helpful

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,132
karshinkoff's avatar
karshinkoff
Unread hot topic
56 4,728
MPPlantOfficial's avatar
MPPlantOfficial
Unread hot topic
76 9,272
Pandadoor's avatar
Pandadoor