Refactoring: better way to manage weapons

This commit is contained in:
Fabrice Ecaille
2013-11-28 18:23:24 +01:00
parent 9500c64e20
commit 045ae06241
5 changed files with 107 additions and 507 deletions

View File

@@ -256,7 +256,7 @@ Game = {
var bonus = $(this)[0].bonus;
if( collisions.length > 0 ) {
if( bonus.type === "weapon" ) {
Game.ship.weapon = new bonus.clazz;
Game.ship.weapon = new Weapon(bonus.clazz);
$("#current_weapon").setAnimation(bonus.animation.animation);
this.remove();
}