How do I make a P-Switch?

Get help using Construct 3!

Post » Sat Oct 21, 2017 12:06 pm

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? :?
Last edited by LogoGuy2017 on Sun Oct 22, 2017 1:31 pm, edited 1 time in total.
B
9
Posts: 11
Reputation: 377

Post » Sat Oct 21, 2017 8:20 pm

+ 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
Mistakes were made.
B
62
S
30
G
134
Posts: 1,976
Reputation: 75,479

Post » Mon Oct 23, 2017 10:17 am

:twisted:
Banned User
B
2
Posts: 4
Reputation: 158

Post » Mon Oct 23, 2017 9:38 pm

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?
B
9
Posts: 11
Reputation: 377

Post » Mon Oct 23, 2017 9:54 pm

Image

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.
Mistakes were made.
B
62
S
30
G
134
Posts: 1,976
Reputation: 75,479

Post » Mon Oct 23, 2017 10:18 pm

oosyrag wrote:Image

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. ;)
B
9
Posts: 11
Reputation: 377

Post » Mon Oct 23, 2017 10:26 pm

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.
Mistakes were made.
B
62
S
30
G
134
Posts: 1,976
Reputation: 75,479

Post » Mon Oct 23, 2017 11:01 pm

LogoGuy2017 wrote:
oosyrag wrote:Image

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. ;)


Image

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.
B
9
Posts: 11
Reputation: 377

Post » Mon Oct 23, 2017 11:05 pm

Nevermind it works..
Thanks for helping me! :)
B
9
Posts: 11
Reputation: 377


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 0 guests