Spriteset_Battle.prototype.createEnemies = function() {
var enemies = $gameTroop.members();
var sprites = [];
for (var i = 0; i < enemies.length; i++) {
sprites[i] = new Sprite_Enemy(enemies[i]);
}
sprites.sort(this.compareEnemySprite.bind(this));
for (var j = 0; j < sprites.length; j++) {
this._battleField.addChild(sprites[j]);
}
this._enemySprites = sprites;
};
Spriteset_Battle.prototype.compareEnemySprite = function(a, b) {
if (a.y !== b.y) {
return a.y - b.y;
} else {
return b.spriteId - a.spriteId;
}
};
Spriteset_Battle.prototype.createEnemies = function() {
var enemies = $gameTroop.members();
var sprites = [];
for (var i = 0; i < enemies.length; i++) {
sprites[i] = new Sprite_Enemy(enemies[i]);
}
sprites.sort(this.compareEnemySprite.bind(this));
for (var j = 0; j < sprites.length; j++) {
this._battleField.addChild(sprites[j]);
}
this._enemySprites = sprites;
};
Spriteset_Battle.prototype.compareEnemySprite = function(a, b) {
if (a.y !== b.y) {
return a.y - b.y;
} else {
return b.spriteId - a.spriteId;
}
};