+ 6
p5 Array Trouble
Every 1 second the program is meant to spawn a circle in a random location and push it to the array. Once spawned, it is meant to stay in that location, not teleport everywhere. Why isn't it working? https://code.sololearn.com/WeLuUVw4NvuS/?ref=app
2 Respuestas
+ 3
Still not working, although, if I do that it will spawn one every millisecond instead of every second (I think)
+ 1
You are overwriting the balls locations every sec, so there can't stay.
And another issue is you should not use setInterval in draw, since draw is a timer function too, it run continusly.
Try put spawnObjs() directly into draw function without setInterval.