Skip to content

Commit

Permalink
Merge pull request #20 from EChamb1021/start-menu-redesign--eileen
Browse files Browse the repository at this point in the history
Start menu redesign  eileen
  • Loading branch information
fernjager authored Mar 20, 2023
2 parents 8e1d382 + 6d400b9 commit 1b7242f
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 24 deletions.
8 changes: 4 additions & 4 deletions js/dialogue.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ function DialogUI( stage, gameState ){
this.showDialog= function( textSeq ){
if(DEBUG) console.log("showing"+ textSeq);
if( !peopleImg["Me"] ){
peopleImg["Me"] = peopleImg[gameState.gender];
peopleImg["Me"] = peopleImg[gameState.playerGender];
}

if( !peopleImg["Spouse"] ){
if( gameState.gender == "Male" ){
peopleImg["Spouse"] = peopleImg["Girlfriend"] ;
}else{
if( gameState.partnerGender == "Male" ){
peopleImg["Spouse"] = peopleImg["Boyfriend"] ;
}else{
peopleImg["Spouse"] = peopleImg["Girlfriend"] ;
}
}

Expand Down
2 changes: 2 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function GameState(){
this.gameStarted = false;
this.name = "";
this.gender = "Male";
this.partnerGender = "Male";
this.pronoun = "he";
this.partnerPronoun = "he";
this.wallet = 45.00;
this.hard = false;
this.boughtOvenLight = false;
Expand Down
98 changes: 78 additions & 20 deletions js/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function MainScreen( stage, gameState ){
function DifficultyScreen( stage, gameState ){
var that = this;

this.background = new createjs.Bitmap( "res/screens/DifficultyScreen/Difficulty-Selection.png" );
this.background = new createjs.Bitmap( "res/screens/DifficultyScreen/Difficulty-SelectionRevised.png" );
stage.addChild( this.background );

var turkeyAnimations = { peck:[14,24,"peck"], ruffle:[0,13,"ruffle"], stare:[25,35,"stare"] };
Expand Down Expand Up @@ -148,15 +148,30 @@ function DifficultyScreen( stage, gameState ){
stage.addChild( this.grassLayer );

// Difficulty selection UI
this.buttonsAndText = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonsandText.png" );
this.buttonsAndText = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonsandTextRevised.png" );
stage.addChild( this.buttonsAndText );

this.maleSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonMale.png" );
stage.addChild( this.maleSelection );
this.malePlayerSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonPlayerMale.png" );
stage.addChild( this.malePlayerSelection );

this.femaleSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonFemale.png" );
this.femaleSelection.alpha = 0;
stage.addChild( this.femaleSelection );
this.femalePlayerSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonPlayerFemale.png" );
this.femalePlayerSelection.alpha = 0;
stage.addChild( this.femalePlayerSelection );

this.malePartnerSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonPartnerMale.png" );
stage.addChild( this.malePartnerSelection );

this.femalePartnerSelection = new createjs.Bitmap( "res/screens/DifficultyScreen/ButtonPartnerFemale.png" );
this.femalePartnerSelection.alpha = 0;
stage.addChild( this.femalePartnerSelection );

// Difficulty
this.casualMode = new createjs.Bitmap( "res/screens/DifficultyScreen/DifficultyCasual.png" );
stage.addChild( this.casualMode );

this.hardcoreMode = new createjs.Bitmap( "res/screens/DifficultyScreen/DifficultyHardcore.png" );
this.hardcoreMode.alpha = 0;
stage.addChild( this.hardcoreMode );

var nameInput = new createjs.Text( "", "48px Arial", "black" );
nameInput.x = 47;
Expand Down Expand Up @@ -204,27 +219,70 @@ function DifficultyScreen( stage, gameState ){
event.preventDefault();
}

// Easy/Hard Button
stage.addChild( new Button( stage, gameState, 500, 235, 100, 55, "ChangeGender", "Male" ) );
stage.addChild( new Button( stage, gameState, 500, 300, 100, 55, "ChangeGender", "Female" ) );
// Player and partner gender
stage.addChild( new Button( stage, gameState, 530, 205, 50, 25, "ChangePlayerGender", "Male" ) );
stage.addChild( new Button( stage, gameState, 625, 205, 50, 25, "ChangePlayerGender", "Female" ) );

stage.addChild( new Button( stage, gameState, 530, 290, 50, 25, "ChangePartnerGender", "Male" ) );
stage.addChild( new Button( stage, gameState, 625, 290, 50, 25, "ChangePartnerGender", "Female" ) );

// Easy/Hard Button
// stage.addChild( new Button( stage, gameState, 535, 335, 160, 40, null, null, function(){ document.onkeyup = function(){}; gameState.hard = false; gameState.gameStarted = true; gameState.hardcoreModifier=1; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );
// stage.addChild( new Button( stage, gameState, 535, 435, 160, 40, null, null, function(){ document.onkeydown = function(){}; gameState.hard = true; gameState.gameStarted = true; gameState.hardcoreModifier=20; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );

stage.addChild( new Button( stage, gameState, 503, 370, 200, 55, null, null, function(){ document.onkeyup = function(){}; gameState.hard = false; gameState.gameStarted = true; gameState.hardcoreModifier=1; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );
stage.addChild( new Button( stage, gameState, 500, 495, 205, 55, null, null, function(){ document.onkeydown = function(){}; gameState.hard = true; gameState.gameStarted = true; gameState.hardcoreModifier=20; gameState.pubsub.publish("SwitchScreen", "KitchenScreen"); } ) );
stage.addChild( new Button( stage, gameState, 535, 335, 160, 40, "SetDifficulty", "Casual" ) );
stage.addChild( new Button( stage, gameState, 535, 435, 160, 40, "SetDifficulty", "Hardcore" ) );

// back button
stage.addChild( new Button( stage, gameState, 35, 495, 85, 55, "SwitchScreen", "MainScreen" ) );

gameState.pubsub.subscribe( "ChangeGender", function(gender){
gameState.gender=gender;
// start button
stage.addChild( new Button( stage, gameState, 535, 530, 200, 50, "StartGame", null ) );

gameState.pubsub.subscribe( "ChangePlayerGender", function(gender){
gameState.playerGender=gender;
if( gender == "Male" ){
that.maleSelection.alpha = 1;
that.femaleSelection.alpha = 0;
gameState.pronoun = "he";
that.malePlayerSelection.alpha = 1;
that.femalePlayerSelection.alpha = 0;
gameState.playerPronoun = "he";
}else{
that.maleSelection.alpha = 0;
that.femaleSelection.alpha = 1;
gameState.pronoun = "she";
that.malePlayerSelection.alpha = 0;
that.femalePlayerSelection.alpha = 1;
gameState.playerPronoun = "she";
}
})
gameState.pubsub.subscribe( "ChangePartnerGender", function(gender){
gameState.partnerGender=gender;
if( gender == "Male" ){
that.malePartnerSelection.alpha = 1;
that.femalePartnerSelection.alpha = 0;
gameState.partnerPronoun = "he";
}else{
that.malePartnerSelection.alpha = 0;
that.femalePartnerSelection.alpha = 1;
gameState.partnerPronoun = "she";
}
})

gameState.pubsub.subscribe( "SetDifficulty", function(difficulty){
if ( difficulty == "Casual") {
gameState.hard = false;
gameState.hardcoreModifier = 1;
that.casualMode.alpha = 1;
that.hardcoreMode.alpha = 0;
} else {
gameState.hard = true;
gameState.hardcoreModifier = 20;
that.casualMode.alpha = 0;
that.hardcoreMode.alpha = 1;
}
})

gameState.pubsub.subscribe( "StartGame", function(){
gameState.gameStarted = true;
gameState.pubsub.publish("SwitchScreen", "KitchenScreen");
})

return {
blit : function(){
if( createjs.Ticker.getTicks() %50 == 0 ){
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 res/screens/DifficultyScreen/ButtonPlayerMale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1b7242f

Please sign in to comment.