I'm making this game that has powerups in it. It works great, but the problem is that sometimes the powerups spawn directly under my player. Since i have a power up that kills the player, i don't want this. The game is a platform game, with max x=1920. Can somebody help me make sure that the powerups spawn like 50 pixels away from my player. This is how my powerups now look like.
powerupspawn = 14 ---> create object (powerup) on layer 1 at (random(0, 1920), 850)
Can anyone help me? I read some other posts but i really didn't get how i should do this. It is also hard to test, because it doesn't happen frequently. So really need help. Game is almost ready to publish!