@ctrembla – This is a forum for Processing / p5.js.
Are you using Processing, and are you trying to write p5.js using the Processing PDE editor? You don’t say anything about how your spaceInvaders.js game was coded, and all I see in your code is JQuery.