OwlCyberSecurity - MANAGER
Edit File: titlescreen.js
var titleScreen = function(game) { MuteBool = false; gamepaused = false; GameTitle = "mabel_dress_up"; gpLink = "https://play.google.com/store/apps/details?id=air.net.kawaiigames.mabelavatarmaker" } titleScreen.prototype = { create: function() { //this.game.renderer.renderSession.roundPixels = true; //add the background music BgMusic = this.add.audio("backgroundmusic"); //.loop = true will make the background music loop BgMusic.loop = true; //set the BgMusic volume to 0.7. 1 is default BgMusic.volume = 1; //we then play the background music BgMusic.play(); //add the Play button sound effects PlaySfx = this.add.audio("playsfx"); //add the starsue logo sound effects in the dress up scene StarsueSfx = this.add.audio("starsuesfx"); /*I added this two variables for you to save some time typing this.world.centerX and centerY to make the graphics appear in the middle of the screen*/ CenterX = this.world.centerX; CenterY = this.world.centerY; //add the Background image Background = this.add.image(0,0,"background"); Background.tint = 0xE6CDDC; Background_Details = this.add.image(0,-4,"background_details"); //Ref = this.add.image(0,0,"ref"); //Doll Intro_Character = this.add.sprite(268,594,"intro_character"); Intro_Character.anchor.setTo(0.5,0.5); //Intro_Character.smoothed = false; //add the title of the game Title = this.add.image(788,263,"title"); Title.anchor.setTo(0.5,0.5); GP_Btn = this.add.button(330,569,"gp_btn",function() { window.open(gpLink,"_blank"); },this); GP_Btn.anchor.setTo(0.5,0.5); //add the Play Button sprite Play_Btn = this.add.button(819,571,"play_btn",function() { adStart(this.game.sound); window[window.preroll.config.loaderObjectName].refetchAd(); this.state.start("DressUp"); },this,1,0,2); Play_Btn.anchor.setTo(0.5,0.5); Logo = this.add.button(85,433,"logo",function() { window.open("http://www.kawaiigames.net/?utm_source="+ GameTitle + "&utm_medium=html5game","_blank"); },this,1,0,2); Logo.anchor.setTo(0.5,0.5); Logo.scale.setTo(1,1); Logo.smoothed = false; Logo2 = this.add.button(78,528,"logo2",function() { window.open("http://www.missangestgames.com/?utm_source="+ GameTitle + "&utm_medium=html5game","_blank"); },this,1,0,2); Logo2.anchor.setTo(0.5,0.5); Logo2.scale.setTo(1,1); Logo2.smoothed = false; Credits_Btn = this.add.button(75,605,"credits_btn",function() { //hide the Credits_Btn Credits_Btn.visible = false; //make the Credits_Group visible Credits_Group.visible = true; //disable all buttons that is not meant to be clickable when Credits shows up Play_Btn.inputEnabled = false; },this,1,0,2); Credits_Btn.anchor.setTo(0.5,0.5); //---------------------------------------------------------// //Credits Screen //Screen_Effect (black screen at the back of the credits screen) //the first 0 is the x and the second 0 is the y Screen_Effect = this.add.sprite(0,0,"screen_effect"); //Credits_Text includes the credits text and the pink border Credits_Text = this.add.sprite(0,0,"credits_text"); Credits_Text.anchor.setTo(0.5,0.5); Credits_Text.x = CenterX; Credits_Text.y = CenterY; Link_Btn = this.add.button(614,317,"link_btn",function() { window.open("https://www.youtube.com/watch?v=F7hmMGjUYyQ","_blank"); },this); Link_Btn.anchor.setTo(0.5,0.5); Link_Btn.scale.setTo(7.3,0.3); Link_Btn.alpha = 0; Link_Btn2 = this.add.button(601,356,"link_btn",function() { window.open("http://www.missangestgames.com/?utm_source="+ GameTitle + "&utm_medium=html5game","_blank"); },this); Link_Btn2.anchor.setTo(0.5,0.5); Link_Btn2.scale.setTo(2.5,0.3); Link_Btn2.alpha = 0; Link_Btn3 = this.add.button(624,396,"link_btn",function() { window.open("http://www.kawaiigames.net/?utm_source="+ GameTitle + "&utm_medium=html5game","_blank"); },this); Link_Btn3.anchor.setTo(0.5,0.5); Link_Btn3.scale.setTo(2,0.3); Link_Btn3.alpha = 0; //Close button at the upper right corner of the Credits_Text /*We add it as a sprite so that we can make it zoom in and zoom out by scaling it when the user click the close button*/ Close_Btn = this.add.button(Credits_Text.x + Credits_Text.width/2 - 35,Credits_Text.y - Credits_Text.height/2 + 35,"close_btn",function() { //we make the Credits_Group invisible and the Credits_Btn visible again Credits_Group.visible = false; Credits_Btn.visible = true; //enable all buttons that is meant to be clickable when Credits is closed Play_Btn.inputEnabled = true; },this,1,0,2); Close_Btn.anchor.setTo(0.5,0.5); //Group that will hold all the graphics that we need for the credits screen Credits_Group = this.add.group(); Credits_Group.add(Screen_Effect); Credits_Group.add(Credits_Text); Credits_Group.add(Link_Btn); Credits_Group.add(Link_Btn2); Credits_Group.add(Link_Btn3); Credits_Group.add(Close_Btn); //we make it initially invisible to hide it from the users view Credits_Group.visible = false; //sound button SoundBtn = this.add.button(46,42,"sound_btn", function() { if(!MuteBool) { SoundBtn.animations.play("soundOff"); this.sound.mute = true; MuteBool = true; } else if(MuteBool) { SoundBtn.animations.play("soundOn"); this.sound.mute = false; MuteBool = false; } },this); SoundBtn.anchor.setTo(0.5,0.5); SoundBtn.animations.add("soundOn",[0],1,false); SoundBtn.animations.add("soundOff",[1],1,false); PosTextBool = false; /*PosTextBool = true; PosText = this.add.text(870,110,"Hello",{font:"40px Arial",fill:"#ffffff"}); PosText.anchor.setTo(0.5,0.5); PosText.setShadow(3,3,"rgba(0,0,0,0.5)",2); debug_fnc(PosText);*/ }, update: function() { //this.sound.mute = true; //this.state.start("DressUp"); }, }