[client] update SoundManager

This commit is contained in:
2019-04-05 16:29:17 +03:00
parent f34d35e03a
commit c3db9f2414
7 changed files with 105 additions and 23 deletions

View File

@@ -303,8 +303,8 @@ class Game extends GameDispatcher {
private function spawnBonus(?type:BonusType):Void {
var bonusConfig:BonusConfig = type != null ? config.getBonus(type) : config.bonuses[Math.floor(Math.random() * config.bonuses.length)];
var bonus = new Bonus(bonusConfig);
bonus.rect.x = Math.random() * engine.map.width;
bonus.rect.y = Math.random() * engine.map.height;
bonus.rect.x = Math.round(Math.random() * engine.map.width / engine.map.cellWidth) * engine.map.cellWidth;
bonus.rect.y = Math.round(Math.random() * engine.map.height/ engine.map.cellHeight) * engine.map.cellHeight;
engine.spawn(bonus);
}