9 years ago by Brushbender
Is there any way of making entities spawn at random positions?
This is my code so far.
This is my code so far.
var asteroidSettings; for (var i = 0; i < 20; i++) { asteroidSettings = {vel: {x: 100-Math.random()*200, y: 100-Math.random()*200}}; this.spawnEntity(EntityAsteroid, ig.system.width/2, ig.system.height/2, asteroidSettings); };