samedi 30 mai 2015

How to make an object randomly spawn inside of the stage only

My stage size is 640 x 1136

I want to spawn my objects randomly but only inside of the stage.

I used this

object.x = Math.random() * stage.stageHeight;

How can I make the x position spawn within the stage area?

Aucun commentaire:

Enregistrer un commentaire