Path: blob/main/public/games/files/space-invaders/assets/javascript/module/Bullets.js
1520 views
/**1* Created by stryker on 2014.03.05..2*/3define(function(){4var _game = null;56var _Bullets = function(quantity,type,damage){7var _bulletGroup = _game.add.group();8_bulletGroup.enableBody = true;9_bulletGroup.physicsBodyType = Phaser.Physics.ARCADE;10_bulletGroup.createMultiple(quantity,type);11_bulletGroup.setAll('anchor.x',0.5);12_bulletGroup.setAll('anchor.y',1);13_bulletGroup.setAll('outOfBoundsKill',true);1415//costume property16_bulletGroup.setAll('bulletDamage',damage);1718return{19getBulletGroup : function(){20return _bulletGroup;21}22}2324};2526return{27init: function(game){28_game = game;29},30preload: function(){31_game.load.image('bullet','assets/img/bullet.png');32_game.load.image('enemyBullet','assets/img/enemy-bullet.png');33},34create: function(quantity,type,damage){35return( new _Bullets(quantity,type,damage) );36}37}38});3940