I am making a game where red squares spawn on the right side of the screen. So far the red squares spawn all the way up and down the height of the stage.
The problem is that i want the red squares to spawn only in areas randomly below a certian height of the stage
This is the code so far
enemy.x = 470 ; enemy.y = Math.random() * stage.stageHeight;
This code makes the red squares spawn all the way up and down the height of the stage
Thanks for any help