Use macros where possible
You can invoke gcc as below to use it to preprocess files not in the C language:
gcc -E -P - < main_src.js > main.js
Knowing that, changing this
function Move(obj){
obj.x += obj.dx;
obj.y += obj.dy;
}
function Collision(a, b){
return (Math.abs(a.x - b.x) < (a.radius + b.radius) && Math.abs(a.y - b.y) < (a.radius + b.radius));
}
into this
#define Move(obj) \
obj.x += obj.dx; \
obj.y += obj.dy;
#define Collision(a, b) (Math.abs(a.x - b.x) < (a.radius + b.radius) && Math.abs(a.y - b.y) < (a.radius + b.radius))
can enable a significant performance improvement, due to the cost of function calls.