Spawning stuff randomly (Now crashing the Game!)

@“JR 01” i know your good with this stuff, other people can answer to.
in my game https://flowlab.io/game/play/1107855 how do I make power ups spawn randomly and not spawn on spikes or enemy’s in a place where the player can get to.
Please be detailed.

I would create a spawner that would extract (or being messaged) the Y coordinates of the player.
Using an expression spawn the power-up just above the screen and keeping the X in the with of the screen. This will randomly spawn the power up.

To make the power up delete, make the power up itself delete if its on top of something (either by collision or proximity). sending a message to spawn another power up after deleting that one would help to have a power up available.

If your looking at specific spots to plant power ups, try setting the max and min of the X at certain heights (if player Y is above ##). Or just have have a random power up be at that spot.

How would make the power ups spawn at random times like either every 10 or 11 or 12 15 do I use a random then a filter and then which ever filter would start the certain timer for extracting?

@“JR 01”

Thanks Ill try it out I might need some help on the way

@“JR 01” when I place a power up on a spike its supposed to send a message and destroy itself.
But instead it does nothing. I just figured out proximity works

Sorry, just got back on the computer @“Johnny boy”.
I don’t exactly know what your asking with the timers, but the random filter seems to do good.
I guess you also fixed the power up on spikes issue?

@“JR 01” I did the whole system but when the timer is done and its about to spawn, EVERYTHING turns white, and the game crashes!Please Help
@grazer? @“JR 01”

Actually I think it might be when you touch a brain or maybe both!
Edit: Nevermind its not when you touch a brain

bump

Seems to work now but the power ups aren’t spawning,
was the power-ups the issue?

I just disabled it i will enable it in a second please reply soon!

@“JR 01” I just enabled it Please try it again.

@“Johnny boy”
power-ups still aren’t spawning

@“JR 01” yeah thats because it crashes right before it

You also have to be 15 to 20 seconds into the game

I made it to 40 and no power-ups

@“JR 01” try it right now I just fixed it Reload your page

@“JR 01” when you go to trouble shoot it make sure you go into the object called spawner

I can’t really tell whats going on, but we know it’s the spawner.
It doesn’t show the signal to the spawn, but if I would have to guess;

When it spawns on a spike, it deletes it and tells the spawner to spawn a another.
This could be creating a loop and crashing the game for if each new spawn is on a spike.
After a few loops in 1 frame the game could crash.

I think instead of deleting the object, try to move it to the next spot until there isn’t a spike.
This way, it’s the objects job to find a spot instead of the spawner keeps endlessly spawning.