Skip to content

Commit

Permalink
fix: separate scores
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriFS committed Sep 26, 2018
1 parent 10169b3 commit 80a4ad5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
14 changes: 13 additions & 1 deletion client/game-app/src/app/scripts/scenes/followers/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function getPaths() {

const follower = this.add.follower(this.path, 100, 100, 'person').setOrigin(0, 0);
follower.startFollow({
duration: 25000 + duration,
duration: 30000 + duration,
positionOnPath: true,
repeat: -1,
ease: 'Linear',
Expand Down Expand Up @@ -57,3 +57,15 @@ export function updateFollowers() {
this.minionCoords.push(follower.pathVector);
});
}


// 2752 = 91.733333
// 1728 = 57.6
// 1152 = 38.4
// 3200 = 106.66666
// 1280 =
// 768 =
// 1344 =
// 2112 =
// 2240 =
// 2112 =
16 changes: 9 additions & 7 deletions client/game-app/src/app/scripts/scenes/menuScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export class MenuScene extends Phaser.Scene {

constructor () {
super({ key: 'UIScene', active: true });
this.score = 0;
this.scoreP1 = 0;
this.scoreP2 = 0;
}

private socket = Socket.getInstance();
Expand Down Expand Up @@ -44,7 +45,7 @@ export class MenuScene extends Phaser.Scene {
window.innerWidth / 2,
window.innerHeight / 2,
'pixelFont',
'', 38).setOrigin(1).setScale(0.5);
'', 40).setOrigin(1).setScale(0.5);

if (this.playerName === 'player1') {
startMessageText.setText(
Expand Down Expand Up @@ -83,8 +84,10 @@ export class MenuScene extends Phaser.Scene {


game.events.on('addScorePlayer1', function () {
this.score += 1;
player1Score.setText('Robot: ' + this.score);
startMessage.visible = true;
endMessage.visible = true;
this.scoreP1 += 1;
player1Score.setText('Robot: ' + this.scoreP1);

if (this.playerName === 'player1') {
endMessage.setText(['You won!', 'Humanity was obliterated!', 'click to continue playing.']);
Expand All @@ -98,9 +101,8 @@ export class MenuScene extends Phaser.Scene {
game.events.on('addScorePlayer2', function () {
startMessage.visible = true;
endMessage.visible = true;
this.score += 1;

player2Score.setText('Human: ' + this.score);
this.scoreP2 += 1;
player2Score.setText('Human: ' + this.scoreP2);

if (this.playerName === 'player1') {
endMessage.setText(['You lost!', 'Humanity was saved!', 'click to continue playing.']);
Expand Down
Binary file modified client/game-app/src/assets/font/font_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 80a4ad5

Please sign in to comment.