Hi everyone! I’m having some trouble achieving concurrent movement of all the incoming enemies in a game I’m working on. I have all my enemy sprite objects stored in an array. Every random interval of time, I want one enemy from the array to start moving towards the bottom of the screen at a randomly-assigned speed, and while it’s moving I want the next enemy start heading towards the bottom of the screen… but I can’t quite figure out how to implement this.
JSFiddle: https://jsfiddle.net/carstrom/4gz1mf8u/
(go the the update loop for the most relevant code)
(the black boxes should head towards the clipboard, they need to be seperate objects because each enemy has different dimensions)
Please let me know if any additional details might be helpful. Thanks so much in advance!