Im having serious trouble

If you want the powerup to turn back off after using, you will have to set the global variable Powerup_Player1 to 0, which means no powerup. This will probably be different for each powerup. But once the powerup is done, you should have a number block with 0 go into “set” on the global variable. That will set all instances of the variable to 0.

Also, name the variable “Powerup_Player1” instead of “Powerup_Play.” It cuts off after a certain number of letters but then you can make variables for Player2 or CPU2 etc

@johnpost when i try to put the 0 number in the global it says i have an infinite loop

sry again could u give one more screenshot of all the behaviors because im not understanding, im slow lol @johnpost

Send me what gave you an infinite loop. I will look into it more later today and give some more help

This is what I think you will need:

The powerup box (that has the other code I showed you) sends out mail based on which powerup you got. The player receives the mail (shown here). Once the player receives the mail, the corresponding switch opens and pressing “O” uses the powerup. You want the powerup to “go away” after using it, so you will want to hook up the zero -> global var “Powerup_Player1” to the out of the switch. That means after you use the powerup (by having the mail sent to player and pressing “O”), the variable will turn to 0, which means no powerup.

So the only thing you need to add is the number block and variable block at the top right, the rest is all there already.

it worked thank you! @johnpost

1 Like

Awesome! let me know if you have issues with it later or need help with other things, I will try to help out

okay! (has to be at least 20 characters.)

1 Like

Can you PLZ explain what global blocks are? I cannot seem to understand them?

Perhaps this could help you @Tim01.
https://flowlab.io/behavior_handbook/#logic-math-global

Look at what @MetaNinja posted. I will also try to explain here. Basically, the global variable block stores a value. Anytime you use the global block with the same name, it holds the same value. So you can keep values across the entire game and use them when called.

Um, I didn’t quite understand that. Jr 01 has a Game “The Rewind” and I cannot understand how he did the menu thing where if you fail the menu pops up and gives you options?

@JR_01you could just use one number, and each number corresponds to one power.