How do I Make Platforms Vanish After Walking on Them

0 favourites
  • 4 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • So I have been struggling with this for a while now. I want to make it so that my player Sprite can move across a solid Sprite using the platformer movement and after the player is no longer touching the platform, the platform should disappear - I can't seem to find the right event to make this happen.

  • Give it a variable. It's 0, in collition with player, set it to 1, you could start a timer to get rid of it.. or, when player distance is further than 30 (eg) and the variable is 1, destroy the platform.

    A Boolean would also work

  • Add the an instance variable (boolean) to the platform named "trigger"

    Add the Fade behavior on your platform and name it FadeOut.

    --With these properties:

    ---Active on start: Yes

    ---Fade in Time : 0

    ---Wait Time: 0

    ---Fade out Time : 1

    ---Destroy after Fade out : Yes

    Add these events:

    Comment: For the trigger

    +Player - On collision with Platform:

    ->Platform - set boolean (trigger) to true.

    Comment: Fade Out (Destroy Fade Effect)

    +Platform is boolean (trigger)

    ++Player is not overlapping Platform

    -->Platform - FadeOut : Fade Out start

    Comment: Anti-Solid Bug

    +Platform on destroyed

    ++Player is overlapping Platform

    -->Player - Set Y to (Self.Y + 1)

    I hope that works out for your game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This code works great thanks. One more thing, I have several platforms in my game, will I need to do this for every single one of them?

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