Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions accountEqn.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class accountEqn extends Phaser.Scene {
this.room3_activityFiveOpened = false;
this.room3_helpOpen = false;
this.room3_counter = 0;
this.musicToggle = false;
document.getElementById("background").volume = 0.8;
}
//load assets in preload()
Expand Down Expand Up @@ -48,13 +47,13 @@ class accountEqn extends Phaser.Scene {

if (Phaser.Input.Keyboard.JustDown(this.room3_key_N)) {
document.getElementById("background").play();
if (this.musicToggle == false) {
if (musicToggle == false) {
document.getElementById("background").play();
this.musicToggle = true;
musicToggle = true;
}
else if (this.musicToggle == true) {
else if (musicToggle == true) {
document.getElementById("background").pause();
this.musicToggle = false;
musicToggle = false;
}
}

Expand Down
Binary file added assets/MTOffTransparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/MTOnTransparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 32 additions & 6 deletions bbActRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class bbActRoom extends Phaser.Scene {
super("BB_ActRoom");
this.room2a_helpOpen = false;
this.room2a_characterMoveable = true;
this.musicToggle = false;
}
//load assets in preload()

Expand Down Expand Up @@ -42,14 +41,15 @@ class bbActRoom extends Phaser.Scene {

if (Phaser.Input.Keyboard.JustDown(this.room2a_key_N)) {
document.getElementById("background").play();
if (this.musicToggle == false) {
if (musicToggle == false) {
document.getElementById("background").play();
this.musicToggle = true;
musicToggle = true;
}
else if (this.musicToggle == true) {
else if (musicToggle == true) {
document.getElementById("background").pause();
this.musicToggle = false;
musicToggle = false;
}
this.musicToggled();
}


Expand Down Expand Up @@ -129,6 +129,8 @@ class bbActRoom extends Phaser.Scene {
// this.load.image('room2a_puzzle1', 'assets/Room2Act1/Puzzle/Puzzle/Puzzle1A.png');
this.load.image('room2a_parents', 'assets/Room2Act2/couple.png');
this.load.image('singleCoin', 'assets/Coin/singleCoin.png');
this.load.image('MTOn', 'assets/MTOnTransparent.png');
this.load.image('MTOff', 'assets/MTOffTransparent.png');
}

/* createImages
Expand All @@ -155,6 +157,8 @@ class bbActRoom extends Phaser.Scene {
// this.room2a_puzzle1 = this.add.image(1168, 400, 'room2a_puzzle1');
this.room2a_parents = this.add.image(868, 611, 'room2a_parents');
this.countCoin = this.add.image(40, 150, 'singleCoin');
this.MTOn = this.add.image(50, 750, 'MTOn');
this.MTOff = this.add.image(50, 750, 'MTOff');
}

/* setAlphas
Expand All @@ -174,7 +178,14 @@ class bbActRoom extends Phaser.Scene {
this.countCoin.alpha = 0.0;
this.coin0.alpha = 1.0;
this.coinHead.alpha = 0.0;

if (musicToggle == false) {
this.MTOff.alpha = 1.0;
this.MTOn.alpha = 0.0;
}
if (musicToggle == true) {
this.MTOn.alpha = 1.0;
this.MTOff.alpha = 0.0;
}
}

/* setDepths
Expand All @@ -192,6 +203,8 @@ class bbActRoom extends Phaser.Scene {
this.room2a_notebook.setDepth(100);
this.room2a_help_menu.setDepth(100);
this.countCoin.setDepth(0);
this.MTOn.setDepth(0);
this.MTOff.setDepth(0);
}

/* setScales
Expand All @@ -215,6 +228,8 @@ class bbActRoom extends Phaser.Scene {
this.countCoin.setScale(0.25);
this.coin0.setScale(0.5);
this.coinHead.setScale(0.5);
this.MTOn.setScale(0.2);
this.MTOff.setScale(0.2);
}

/* setRotations
Expand Down Expand Up @@ -548,6 +563,17 @@ class bbActRoom extends Phaser.Scene {
this.count.setText('x ' + coinCount);
}

musicToggled() {
if (musicToggle == false) {
this.MTOn.alpha = 0.0;
this.MTOff.alpha = 1.0;
}
else if (musicToggle == true) {
this.MTOff.alpha = 0.0;
this.MTOn.alpha = 1.0;
}
}

/* helpMenu
*
* Sets the alpha of the help menu to 1 so that it is visible
Expand Down
57 changes: 42 additions & 15 deletions buildBlockAct0.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class buildBlockAct0 extends Phaser.Scene {
this.paperCount = 1;
this.maxPaper = 3;
this.counter = 0;
this.musicToggle = false;
document.getElementById("background").volume = 0.8;
}
//load assets in preload()
Expand Down Expand Up @@ -49,14 +48,15 @@ class buildBlockAct0 extends Phaser.Scene {
if (Phaser.Input.Keyboard.JustDown(this.key_N)) {

document.getElementById("background").play();
if (this.musicToggle == false) {
if (musicToggle == false) {
document.getElementById("background").play();
this.musicToggle = true;
musicToggle = true;
}
else if (this.musicToggle == true) {
else if (musicToggle == true) {
document.getElementById("background").pause();
this.musicToggle = false;
musicToggle = false;
}
this.musicToggled();
}

if (roomProgress <= 2200) {
Expand Down Expand Up @@ -217,6 +217,8 @@ class buildBlockAct0 extends Phaser.Scene {
this.load.image('balanceSheet', 'assets/Documents/balanceSheet.png');
this.load.image('retainedEarnings' , 'assets/Documents/retainedEarnings.png');
this.load.image('singleCoin', 'assets/Coin/singleCoin.png');
this.load.image('MTOn', 'assets/MTOnTransparent.png');
this.load.image('MTOff', 'assets/MTOffTransparent.png');
}

/* createImages
Expand Down Expand Up @@ -251,6 +253,8 @@ class buildBlockAct0 extends Phaser.Scene {
this.balanceSheet = this.add.image(768, 432, 'balanceSheet');
this.retainedEarnings = this.add.image(768, 432, 'retainedEarnings');
this.countCoin = this.add.image(40, 150, 'singleCoin');
this.MTOn = this.add.image(50, 750, 'MTOn');
this.MTOff = this.add.image(50, 750, 'MTOff');
}

/* setAlphas
Expand All @@ -266,22 +270,30 @@ class buildBlockAct0 extends Phaser.Scene {
this.help_menu.alpha = 0.0;
this.r2a0_walls.alpha = 1;
this.r2a0_floor.alpha = 1;
this.returnDoor.alpha = 1;
// FinStmt sorting activity w/ boxes is not in room1 anymore...
this.SreBox.alpha = 1;
this.ScfBox.alpha = 1;
this.BalShtBox.alpha = 1;
this.IncStmBox.alpha = 1;
this.paper.alpha = 1;
// this.paper_stack.alpha = 1;

this.wall_info_2.alpha = 1;
this.returnDoor.alpha = 1;
// FinStmt sorting activity w/ boxes is not in room1 anymore...
this.SreBox.alpha = 1;
this.ScfBox.alpha = 1;
this.BalShtBox.alpha = 1;
this.IncStmBox.alpha = 1;
this.paper.alpha = 1;
// this.paper_stack.alpha = 1;

this.wall_info_2.alpha = 1;
this.incomeStatement.alpha = 0;
this.balanceSheet.alpha = 0;
this.retainedEarnings.alpha = 0;
//this.coin0.alpha = 0.0;
this.coinHead.alpha = 0.0;
this.countCoin.alpha = 1.0;
if (musicToggle == false) {
this.MTOff.alpha = 1.0;
this.MTOn.alpha = 0.0;
}
if (musicToggle == true) {
this.MTOn.alpha = 1.0;
this.MTOff.alpha = 0.0;
}
}

/* setDepths
Expand Down Expand Up @@ -313,6 +325,8 @@ class buildBlockAct0 extends Phaser.Scene {
this.BalShtBox.setDepth(2);
this.returnDoor.setDepth(2);
this.countCoin.setDepth(0);
this.MTOn.setDepth(0);
this.MTOff.setDepth(0);
}

/* setScales
Expand Down Expand Up @@ -340,6 +354,8 @@ class buildBlockAct0 extends Phaser.Scene {
//this.coin0.setScale(0.5);
this.coinHead.setScale(0.5);
this.countCoin.setScale(0.25);
this.MTOn.setScale(0.2);
this.MTOff.setScale(0.2);
}

/* setRotations
Expand Down Expand Up @@ -670,6 +686,17 @@ class buildBlockAct0 extends Phaser.Scene {
this.count.setText('x ' + coinCount);
}

musicToggled() {
if (musicToggle == false) {
this.MTOn.alpha = 0.0;
this.MTOff.alpha = 1.0;
}
else if (musicToggle == true) {
this.MTOff.alpha = 0.0;
this.MTOn.alpha = 1.0;
}
}

/* helpMenu
*
* Sets the alpha of the help menu to 1 so that it is visible
Expand Down
36 changes: 31 additions & 5 deletions buildBlockAct2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class buildBlockAct2 extends Phaser.Scene {
this.room2b_unlocked = false;
this.room2b_helpOpen = false;
this.room2b_count = 1;
this.musicToggle = false;
}
//load assets in preload()

Expand Down Expand Up @@ -42,13 +41,13 @@ class buildBlockAct2 extends Phaser.Scene {
if (Phaser.Input.Keyboard.JustDown(this.room2b_key_N)) {

document.getElementById("background").play();
if (this.musicToggle == false) {
if (musicToggle == false) {
document.getElementById("background").play();
this.musicToggle = true;
musicToggle = true;
}
else if (this.musicToggle == true) {
else if (musicToggle == true) {
document.getElementById("background").pause();
this.musicToggle = false;
musicToggle = false;
}
}

Expand Down Expand Up @@ -279,6 +278,8 @@ class buildBlockAct2 extends Phaser.Scene {
// this.load.image('cashFlows' , 'assets/Documents/cashFlows.jpg');
// this.load.image('room2b_hole', 'assets/hole.png');
this.load.image('singleCoin', 'assets/Coin/singleCoin.png');
this.load.image('MTOn', 'assets/MTOnTransparent.png');
this.load.image('MTOff', 'assets/MTOffTransparent.png');
}

/* createImages
Expand Down Expand Up @@ -332,6 +333,8 @@ class buildBlockAct2 extends Phaser.Scene {
this.questionStack = this.add.image(100, 100, 'questionStack');
// this.room2b_hole = this.add.image(268, 432, 'room2b_hole');
this.countCoin = this.add.image(40, 150, 'singleCoin');
this.MTOn = this.add.image(50, 750, 'MTOn');
this.MTOff = this.add.image(50, 750, 'MTOff');
}

/* setAlphas
Expand Down Expand Up @@ -375,6 +378,14 @@ class buildBlockAct2 extends Phaser.Scene {
this.coin0.alpha = 0.0;
this.hideActivities();
this.countCoin.alpha = 0.0;
if (musicToggle == false) {
this.MTOn.alpha = 0.0;
this.MTOff.alpha = 1.0;
}
if (musicToggle == true) {
this.MTOff.alpha = 0.0;
this.MTOn.alpha = 1.0;
}
}

/* setDepths
Expand Down Expand Up @@ -422,6 +433,8 @@ class buildBlockAct2 extends Phaser.Scene {
this.r2a2_q3_incstmW.setDepth(100);
this.r2a2_congrats.setDepth(100);
this.countCoin.setDepth(0);
this.MTOn.setDepth(0);
this.MTOff.setDepth(0);
}

/* setScales
Expand Down Expand Up @@ -455,6 +468,8 @@ class buildBlockAct2 extends Phaser.Scene {
this.coinHead.setScale(0.5);
this.coin0.setScale(0.5);
this.countCoin.setScale(0.25);
this.MTOn.setScale(0.2);
this.MTOff.setScale(0.2);
}

/* setRotations
Expand Down Expand Up @@ -1219,6 +1234,17 @@ class buildBlockAct2 extends Phaser.Scene {
}
*/

musicToggled() {
if (musicToggle == false) {
this.MTOn.alpha = 0.0;
this.MTOff.alpha = 1.0;
}
else if (musicToggle == true) {
this.MTOff.alpha = 0.0;
this.MTOn.alpha = 1.0;
}
}


/* helpMenu
*
Expand Down
Loading