mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
Fixed lots of examples and added the missing Line.js.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user