Fixed lots of examples and added the missing Line.js.

This commit is contained in:
photonstorm
2014-01-31 14:12:20 +00:00
parent 26f2b2a931
commit 5e182d317b
14 changed files with 147 additions and 100 deletions
+7 -7
View File
@@ -28,7 +28,7 @@ var lives;
var enemyBullet;
var firingTimer = 0;
var stateText;
var livingEnemies=[];
var livingEnemies = [];
function create() {
@@ -106,10 +106,10 @@ function createAliens () {
aliens.y = 50;
// All this does is basically start the invaders moving. Notice we're moving the Group they belong to, rather than the invaders directly.
var tween = game.add.tween(aliens).to( { x: 200 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
// var tween = game.add.tween(aliens).to( { x: 200 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
// When the tween completes it calls descend, before looping again
tween.onComplete.add(descend, this);
// tween.onComplete.add(descend, this);
}
function setupInvader (invader) {
@@ -155,8 +155,8 @@ function update() {
}
// Run collision
game.physics.collide(bullets, aliens, collisionHandler, null, this);
game.physics.collide(enemyBullets, player, enemyHitsPlayer, null, this);
// game.physics.collide(bullets, aliens, collisionHandler, null, this);
// game.physics.collide(enemyBullets, player, enemyHitsPlayer, null, this);
}
@@ -167,8 +167,8 @@ function collisionHandler (bullet, alien) {
alien.kill();
// Increase the score
score+=20;
scoreText.content=scoreString+score;
score += 20;
scoreText.content = scoreString + score;
// And create an explosion :)
var explosion = explosions.getFirstDead();