This site requires JavaScript, please enable it in your browser!
Greenfoot back
MoleKingQ
MoleKingQ wrote ...

2020/3/16

Increase rate of spawning for enemies

MoleKingQ MoleKingQ

2020/3/16

#
Hi guys, I have created a game where zombies spawn at the side of the screen and walk towards the player. I created some code that gives a 2% chance of them spawning which works well at the start but I would like the rate to increase over time to create a sense of challenge. Here is the code I have now:
danpost danpost

2020/3/16

#
MoleKingQ wrote...
I created some code that gives a 2% chance of them spawning which works well at the start but I would like the rate to increase over time to create a sense of challenge. << Links Omitted >>
With regards to the line:
if (percent <= 2)
you will need to make the '2' variable. Declare an instance int field for it so you can adjust its value.
MoleKingQ MoleKingQ

2020/3/17

#
Thank you.
You need to login to post a reply.