GitLab system status is available here and here

Commit eb30fdf0 authored by Ankie Pon's avatar Ankie Pon
Browse files

test push

parent 7ffee330
......@@ -36,12 +36,37 @@ class Play extends Phaser.Scene {
keyLEFT = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.LEFT);
keyRIGHT = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.RIGHT);
//creating animation
//animation config
this.anims.create({
key: 'explode',
frames: this.anims.generateFrameNumbers('explosion', {start: 0, end: 9, first: 0}),
frameRate: 30
});
// initialize score
this.p1Score = 0;
// display score
let scoreConfig = {
fontFamily: 'Courier',
fontSize: '28px',
backgroundColor: '#F3B141',
color: '#843605',
align: 'right',
padding: {
top: 5,
bottom: 5,
},
fixedWidth: 100
}
this.scoreLeft = this.add.text(borderUISize + borderPadding, borderUISize + borderPadding*2, this.p1Score, scoreConfig);
//60 second play clock
scoreConfig.fixedWidth = 0;
this.clock = this.time.delayedCall(60000, () => {
this.add.text(game.config.width/2, game.config.height/2, 'GAME OVER', scoreConfig).setOrigin(0.5);
this.add.text(game.config.width/2, game.config.height/2 + 64, 'Press (R) to Restart', scoreConfig).setOrigin(0.5);
}, null, this);
}
update() {
......@@ -93,5 +118,9 @@ class Play extends Phaser.Scene {
ship.alpha = 1;
boom.destroy();
});
//scpre add and repaint
this.p1Score += ship.points;
this.scoreLeft.text = this.p1Score;
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment