1
0
mirror of https://github.com/danbee/invaders synced 2025-03-04 08:39:08 +00:00

Reduce bullet pool to 3. Tweak bullet start position.

This commit is contained in:
Dan Barber 2014-05-09 17:57:48 +01:00
parent 8fd1db7be8
commit c763d1427b

View File

@ -24,7 +24,7 @@ function create () {
bullets = game.add.group(); bullets = game.add.group();
bullets.enableBody = true; bullets.enableBody = true;
bullets.physicsBodyType = Phaser.Physics.ARCADE; bullets.physicsBodyType = Phaser.Physics.ARCADE;
bullets.createMultiple(5, 'bullet'); bullets.createMultiple(3, 'bullet');
bullets.setAll('anchor.x', 0.5); bullets.setAll('anchor.x', 0.5);
bullets.setAll('anchor.y', 1); bullets.setAll('anchor.y', 1);
bullets.setAll('checkWorldBounds', true); bullets.setAll('checkWorldBounds', true);
@ -81,7 +81,7 @@ function fireBullet () {
if (bullet) { if (bullet) {
// And fire it // And fire it
bullet.reset(player.x, player.y + 8); bullet.reset(player.x, player.y - 16);
bullet.body.velocity.y = -400; bullet.body.velocity.y = -400;
bullet.body.velocity.x = player.body.velocity.x / 4 bullet.body.velocity.x = player.body.velocity.x / 4
bulletTime = game.time.now + 500; bulletTime = game.time.now + 500;