Since you already have the constructor, here is how you can use it:
function fillArray(theArrayToFill,amount,ctor) {
for ( var i = 0; i != amount; ++i ) {
theArrayToFill.push(new ctor(0,0));
}
}
// usage:
fillArray(theArray,3,Enemy);
The way you originally called the fillArray method, you created one object (immediately before the function is called) and passed it as parameter to the fillArray method. The method then proceded to fill the array with references towards that object, so each item in the array would indeed point towards the same object.
EDIT:
No simple solution comes to mind if you want to pass different arguments to the constructor. Here is a hacky one that might be enough for your purposes:
function fillArray(theArrayToFill,amount,ctor) {
for ( var i = 0; i != amount; ++i ) {
theArrayToFill.push(new ctor(arguments[3], arguments[4], arguments[5],
arguments[6], arguments[7], arguments[8], arguments[9], arguments[10],
arguments[11], arguments[12], arguments[13], arguments[14]));
}
}
// usage:
fillArray(theArray,3,Enemy,0,0);
fillArray(theArray,3,Friend,1,2,3,4,5,6,7,8);
Obviously this only works for constructors with less than 12 arguments and some checks based on used parameters in a constructor will also fail, but it gets the job done.
PS: I don't suggest you use this approach. Looks like a clone method is more suited to your purpose.