How do I make a P-Switch?

0 favourites
  • 9 posts
From the Asset Store
Toggles Dials Switches and Alerts ! A foundational sound grouping of Analog type switches and Steampunk effects
  • I am working on a SMW engine on Construct 2, but I am having trouble making a code where when the P switch is hit, the coins turn into hit question blocks. Can you please help?

  • + Function: On "pSwitch"

    + System: For each Coin

    -> Coin: Spawn Block on layer 0 (image point 0)

    -> Block: Start Timer "pSwitch" for 30 (Once)

    -> Coin: Destroy

    + Block: On Timer "pSwitch"

    -> Block: Spawn Coin on layer 0 (image point 0)

    -> Block: Destroy

  • I can't find a "For each" or "On 'ObjectName' statement.

    How do you turn it into action blocks? I'm not dumb, I don't know how to interpret this alien code into readable stuff.

    I also accidentally posted this on Construct 3, Can you please move this to Construct 2's How do I?

  • On "pSwitch" is a function, but you can add whatever trigger you like instead of using a function.

    The "For Each" condition is in system.

    You'll need to add the Timer behavior to your block sprite to get the "Block On Timer" condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On "pSwitch" is a function, but you can add whatever trigger you like instead of using a function.

    The "For Each" condition is in system.

    You'll need to add the Timer behavior to your block sprite to get the "Block On Timer" condition.

    Wow. Thanks! I might need to practice reading the raw code.

  • It's not a big deal. It was a feature added in construct 3 to make it easier to share events without having to take a screenshot, upload, share, and link to the file. As you become more familiar with the available events, conditions, and actions in general, it should make more sense to you. As you can see, the text representation and the picture basically show exactly the same thing.

  • >

    >

    > On "pSwitch" is a function, but you can add whatever trigger you like instead of using a function.

    > The "For Each" condition is in system.

    > You'll need to add the Timer behavior to your block sprite to get the "Block On Timer" condition.

    >

    Wow. Thanks! I might need to practice reading the raw code.

    I tested the code, and all it did for me is output a error and remove the coins completely, causing me to fall and lose a life. Also, after the timer, It doesn't revert to coins. It removes it outright from the map.

  • Nevermind it works..

    Thanks for helping me!

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