Hi all,

I want to randomly generate some powerups as my game objects are loaded (bricks in Breakout).

I was thinking something like:

```
var randomNumber = randi()%101+1
if randomNumber == 1:
#then we have a 1 in 100 chance of being picked
#do stuff here
```

Can anyone give feedback on the code?

The idea is I want to have different chances of a specific powerup being chosen. So something like:

```
if powerup == "speedBall":
#make speedball a 1 in 100 chance of being drawn
var randomNumber = randi()%101+1
if randomNumber == 1:
#then we have a 1 in 100 chance of being picked
#do stuff here
elif powerup == "growBat":
#make growBat a 1 in 40 chance of being drawn
var randomNumber = randi()%41+1
if randomNumber == 1:
#then we have a 1 in 40 chance of being picked
#do stuff here
```

I'm happy to progress with this idea but wanted to check in, see if anyone can see any issues etc or some better suggestion?