How do respawn a falling platform?

0 favourites
  • 7 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • In my game I have multiple instances of falling platforms but I want to have it so that if a player uses the falling platform once it falls and destroys itself I want it to spawn back to its original location?

    Doe any one have any suggestions on how to do that ?

  • In the event that destroys the platform, spawn a new one at it's original location.

    You can keep track of it's original position with a pair of instance variables or an invisible helper sprite.

    An alternative would be to not have the original platform fall at all, just make it invisible, turn off solid, and spawn a dummy sprite to fall instead. Then make it visible and solid again later.

  • Thanks oosyrag,

    your suggestion worked, However I am experiencing one additional problem, in the link below I show how I followed your instructions. But need help figuring out a new issue.

    in the video I show 3 ways to try and resolve the issue I was having. But was indeed able to get the falling platform to fall however its spawns too many objects at a time.

    is there something I am missing in the code ?

    Here is the screenshot of the code

    screencast.com/t/C8RMxPSIdn8

    video shown here below:

    screencast.com/t/mzX0UnW8

  • Trigger once only works when there are other conditions with it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am still working on this issue its starting to become a headache really lol

    I am thinking of just going with an alternative solution

    But I really am trying to tackle this and understand what is causing my problem in this code

    screenshot of the code

    screencast.com/t/YdeyWU94

    video of issues

    screencast.com/t/YsddMZpGM

  • Ok so there's a few problems here, in no particular order"

    Don't use physics unless your whole project is physics based (or you really really know what you're doing).

    Your platform with the sine shaking is probably causing multiple collisions and resets. It is often

    Avoid using wait, it simply delays the actions and doesn't stop events from running in the meantime. Better to use timers and timer triggers for anything that needs to happen over time.

    Using instance variables along with the timer behavior to keep track of the state of various objects could be useful as well. I put together an example for you, hope this helps. dropbox.com/s/2uigcteg6sam753/fallingplatformexample.c3p

  • Nice I see what you did in this project your a freaking genius, I never would have thought about the using the bullet behavior to simulate the gravity. And, yeah I see where the timer and using the instance variable trigger work hand in hand with each other.

    Really help with only the block the player interacts with to run the code for falling while ignoring the others. Until player collides with them as well

    Its working now thanks for your help all of this really appreciate your time

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