OwlCyberSecurity - MANAGER
Edit File: endscreen.js
var endscreen = function(game) { } endscreen.prototype = { create: function() { page = 1; School_Bg = this.add.sprite(0,0,"school_bg"); Cafe_Bg = this.add.sprite(800,0,"coffee_bg"); Bedroom_Bg = this.add.sprite(800,0,"bedroom_bg"); this.DollSchool(); this.DollCafe(); this.DollBedroom(); Prev_Arrow = this.add.button(47,this.world.centerY,"arrow_btn",this.Prev_fnc,this,0,1,2); Prev_Arrow.anchor.setTo(0.5,0.5); Prev_Arrow.visible = false; Next_Arrow = this.add.button(755,this.world.centerY,"arrow_btn",this.Next_fnc,this,0,1,2); Next_Arrow.anchor.setTo(0.5,0.5); Next_Arrow.scale.setTo(-1,1); Replay_Btn = this.add.button(744,547,"replay_btn",function() { resetData(); this.state.start("PickScreen"); },this,0,1,2); Replay_Btn.anchor.setTo(0.5,0.5); Save_Btn = this.add.button(57,456,"save_btn",this.SaveScreenshot,this,0,1,2); Save_Btn.anchor.setTo(0.5,0.5); MoreGames_Btn = this.add.button(57,547,"moregames_btn",function() { window.open("http://www.dressupgames.com/?utm_source=html5-24-hours-of-snow-white&utm_medium=html5-24-hours-of-snow-white&utm_campaign=24-hours-of-snow-white","_blank"); },this,0,1,2); MoreGames_Btn.anchor.setTo(0.5,0.5); Logo_Btn = this.add.button(132,40,"logo_btn",function() { window.open("http://www.dressupgames.com/?utm_source=html5-24-hours-of-snow-white&utm_medium=html5-24-hours-of-snow-white&utm_campaign=24-hours-of-snow-white","_blank"); },this,0,0,1); Logo_Btn.anchor.setTo(0.5,0.5); }, SaveScreenshot: function() { Prev_Arrow.visible = false; Next_Arrow.visible = false; Replay_Btn.visible = false; Save_Btn.visible = false; MoreGames_Btn.visible = false; this.game.time.events.add(90,function() { var a = document.createElement('a'); var Data = this.game.canvas.toDataURL( 'image/png' ).replace( 'image/png', 'image/octet-stream' ); a.setAttribute('download', 'Dress-Up-Games'+ GameTitle +'.png'); a.href = Data; a.innerHTML = 'testing'; a.style.display = 'none'; a.click(); if(School_Bg.x == 0) { Prev_Arrow.visible = false; Next_Arrow.visible = true; } else if(Cafe_Bg.x == 0) { Prev_Arrow.visible = true; Next_Arrow.visible = true; } else if(Bedroom_Bg.x == 0) { Prev_Arrow.visible = true; Next_Arrow.visible = false; } Replay_Btn.visible = true; Save_Btn.visible = true; MoreGames_Btn.visible = true; },this); }, DollSchool: function() { SBody = this.add.sprite(205,338,"body"); SBody.anchor.setTo(0.5,0.5); SHead = this.add.sprite(185,78,"head"); SHead.anchor.setTo(0.5,0.5); SEyes = this.add.sprite(176,82,"eyes"); SEyes.anchor.setTo(0.5,0.5); SBlink = this.add.sprite(177,85,"blink"); SBlink.anchor.setTo(0.5,0.5); SBlink.alpha = 0; this.game.time.events.add(2000,function() { SEyes.alpha = 0; SBlink_Tween = this.add.tween(SBlink).to({alpha: 1},100,Phaser.Easing.Linear.None,true); SBlink_Tween.onComplete.add(function() { var RandNum = Math.floor(Math.random()*(2 - 1 + 1)) + 1; var SBlinkTimer = 0; if(RandNum == 0 || RandNum == 2){SBlinkTimer = 4000;} if(RandNum == 1){SBlinkTimer = 2000;} this.game.time.events.add(50,function() { SEyes.alpha = 1; SBlink.alpha = 0; this.game.time.events.add(SBlinkTimer,function(){SBlink_Tween.start();SEyes.alpha = 0;},this); },this); },this); },this); SHair = this.add.sprite(199,105,"hair"); SHair.anchor.setTo(0.5,0.5); SHair.frame = sHair; STops_Color = this.add.sprite(187,210,"tops_color"); STops_Color.anchor.setTo(0.5,0.5); STops_Color.frame = sTops; STops_Color.tint = sTopsColor; STops_Color.visible = sTopsVisible; STops_Outline = this.add.sprite(STops_Color.x+1,STops_Color.y,"tops_outline"); STops_Outline.anchor.setTo(0.5,0.5); STops_Outline.frame = sTops; STops_Outline.visible = sTopsVisible; SBottoms_Color = this.add.sprite(179,373,"bottoms_color"); SBottoms_Color.anchor.setTo(0.5,0.5); SBottoms_Color.frame = sBottoms; SBottoms_Color.tint = sBottomsColor; SBottoms_Color.visible = sBottomsVisible; SBottoms_Outline = this.add.sprite(SBottoms_Color.x-.5,SBottoms_Color.y,"bottoms_outline"); SBottoms_Outline.anchor.setTo(0.5,0.5); SBottoms_Outline.frame = sBottoms; SBottoms_Outline.visible = sBottomsVisible; SDress_Color = this.add.sprite(167,268,"dress_color"); SDress_Color.anchor.setTo(0.5,0.5); SDress_Color.frame = sDress; SDress_Color.tint = sDressColor; SDress_Color.visible = sDressVisible; SDress_Outline = this.add.sprite(SDress_Color.x-1,SDress_Color.y,"dress_outline"); SDress_Outline.anchor.setTo(0.5,0.5); SDress_Outline.frame = sDress; SDress_Outline.visible = sDressVisible; SShoes_Color = this.add.sprite(205,544,"shoes_color"); SShoes_Color.anchor.setTo(0.5,0.5); SShoes_Color.frame = sShoes; SShoes_Color.tint = sShoesColor; SShoes_Color.visible = sShoesVisible; SShoes_Outline = this.add.sprite(SShoes_Color.x,SShoes_Color.y,"shoes_outline"); SShoes_Outline.anchor.setTo(0.5,0.5); SShoes_Outline.frame = sShoes; SShoes_Outline.visible = sShoesVisible; SAccess = this.add.sprite(176,82,"access"); SAccess.anchor.setTo(0.5,0.5); SAccess.visible = sAccessVisible; SAccess_Bags = this.add.sprite(87,362,"access_bags"); SAccess_Bags.anchor.setTo(0.5,0.5); SAccess_Bags.frame = sAccessBags; SAccess_Bags.visible = sAccessBagsVisible; SAccess2 = this.add.sprite(190,151,"access2") SAccess2.anchor.setTo(0.5,0.5); SAccess2.visible = sAccessVisible2; SAccess3 = this.add.sprite(203,42,"access3"); SAccess3.anchor.setTo(0.5,0.5); SAccess3.visible = sAccessVisible3; School_Group = this.add.group(); if(sBottoms == 3 && sShoes == 0 || sBottoms == 3 && sShoes == 1 || sBottoms == 3 && sShoes == 4 || sBottoms == 3 && sShoes == 5) { School_Group.add(SBody); School_Group.add(SShoes_Color); School_Group.add(SShoes_Outline); School_Group.add(SBottoms_Color); School_Group.add(SBottoms_Outline); School_Group.add(STops_Color); School_Group.add(STops_Outline); School_Group.add(SDress_Color); School_Group.add(SDress_Outline); School_Group.add(SHead); School_Group.add(SEyes); School_Group.add(SBlink); School_Group.add(SAccess2); School_Group.add(SHair); School_Group.add(SAccess); School_Group.add(SAccess_Bags); School_Group.add(SAccess3); } else { School_Group.add(SBody); School_Group.add(SBottoms_Color); School_Group.add(SBottoms_Outline); School_Group.add(SShoes_Color); School_Group.add(SShoes_Outline); School_Group.add(STops_Color); School_Group.add(STops_Outline); School_Group.add(SDress_Color); School_Group.add(SDress_Outline); School_Group.add(SHead); School_Group.add(SEyes); School_Group.add(SBlink); School_Group.add(SAccess2); School_Group.add(SHair); School_Group.add(SAccess); School_Group.add(SAccess_Bags); School_Group.add(SAccess3); } School_Group.x = 200; }, DollCafe: function() { CBody = this.add.sprite(205,338,"body"); CBody.anchor.setTo(0.5,0.5); CHead = this.add.sprite(185,78,"head"); CHead.anchor.setTo(0.5,0.5); CEyes = this.add.sprite(176,82,"eyes"); CEyes.anchor.setTo(0.5,0.5); CBlink = this.add.sprite(177,85,"blink"); CBlink.anchor.setTo(0.5,0.5); CBlink.alpha = 0; this.game.time.events.add(2000,function() { CEyes.alpha = 0; CBlink_Tween = this.add.tween(CBlink).to({alpha: 1},100,Phaser.Easing.Linear.None,true); CBlink_Tween.onComplete.add(function() { var RandNum = Math.floor(Math.random()*(2 - 1 + 1)) + 1; var CBlinkTimer = 0; if(RandNum == 0 || RandNum == 2){CBlinkTimer = 4000;} if(RandNum == 1){CBlinkTimer = 2000;} this.game.time.events.add(50,function() { CEyes.alpha = 1; CBlink.alpha = 0; this.game.time.events.add(CBlinkTimer,function(){CBlink_Tween.start();CEyes.alpha = 0;},this); },this); },this); },this); CHair = this.add.sprite(199,105,"hair"); CHair.anchor.setTo(0.5,0.5); CHair.frame = cHair; CTops_Color = this.add.sprite(187,210,"tops_color"); CTops_Color.anchor.setTo(0.5,0.5); CTops_Color.frame = cTops; CTops_Color.tint = cTopsColor; CTops_Color.visible = cTopsVisible; CTops_Outline = this.add.sprite(CTops_Color.x+1,CTops_Color.y,"tops_outline"); CTops_Outline.anchor.setTo(0.5,0.5); CTops_Outline.frame = cTops; CTops_Outline.visible = cTopsVisible; CBottoms_Color = this.add.sprite(179,373,"bottoms_color"); CBottoms_Color.anchor.setTo(0.5,0.5); CBottoms_Color.frame = cBottoms; CBottoms_Color.tint = cBottomsColor; CBottoms_Color.visible = cBottomsVisible; CBottoms_Outline = this.add.sprite(CBottoms_Color.x-.5,CBottoms_Color.y,"bottoms_outline"); CBottoms_Outline.anchor.setTo(0.5,0.5); CBottoms_Outline.frame = cBottoms; CBottoms_Outline.visible = cBottomsVisible; CDress_Color = this.add.sprite(167,268,"dress_color"); CDress_Color.anchor.setTo(0.5,0.5); CDress_Color.frame = cDress; CDress_Color.tint = cDressColor; CDress_Color.visible = cDressVisible; CDress_Outline = this.add.sprite(CDress_Color.x-1,CDress_Color.y,"dress_outline"); CDress_Outline.anchor.setTo(0.5,0.5); CDress_Outline.frame = cDress; CDress_Outline.visible = cDressVisible; CShoes_Color = this.add.sprite(205,544,"shoes_color"); CShoes_Color.anchor.setTo(0.5,0.5); CShoes_Color.frame = cShoes; CShoes_Color.tint = cShoesColor; CShoes_Color.visible = cShoesVisible; CShoes_Outline = this.add.sprite(CShoes_Color.x,CShoes_Color.y,"shoes_outline"); CShoes_Outline.anchor.setTo(0.5,0.5); CShoes_Outline.frame = cShoes; CShoes_Outline.visible = cShoesVisible; CAccess = this.add.sprite(176,82,"access"); CAccess.anchor.setTo(0.5,0.5); CAccess.visible = cAccessVisible; CAccess_Bags = this.add.sprite(87,362,"access_bags"); CAccess_Bags.anchor.setTo(0.5,0.5); CAccess_Bags.frame = cAccessBags; CAccess_Bags.visible = cAccessBagsVisible; CAccess2 = this.add.sprite(190,151,"access2") CAccess2.anchor.setTo(0.5,0.5); CAccess2.visible = cAccessVisible2; CAccess3 = this.add.sprite(203,42,"access3"); CAccess3.anchor.setTo(0.5,0.5); CAccess3.visible = cAccessVisible3; Cafe_Group = this.add.group(); if(cBottoms == 3 && cShoes == 0 || cBottoms == 3 && cShoes == 1 || cBottoms == 3 && cShoes == 4 || cBottoms == 3 && cShoes == 5) { Cafe_Group.add(CBody); Cafe_Group.add(CShoes_Color); Cafe_Group.add(CShoes_Outline); Cafe_Group.add(CBottoms_Color); Cafe_Group.add(CBottoms_Outline); Cafe_Group.add(CTops_Color); Cafe_Group.add(CTops_Outline); Cafe_Group.add(CDress_Color); Cafe_Group.add(CDress_Outline); Cafe_Group.add(CHead); Cafe_Group.add(CEyes); Cafe_Group.add(CBlink); Cafe_Group.add(CAccess2); Cafe_Group.add(CHair); Cafe_Group.add(CAccess); Cafe_Group.add(CAccess_Bags); Cafe_Group.add(CAccess3); } else { Cafe_Group.add(CBody); Cafe_Group.add(CBottoms_Color); Cafe_Group.add(CBottoms_Outline); Cafe_Group.add(CShoes_Color); Cafe_Group.add(CShoes_Outline); Cafe_Group.add(CTops_Color); Cafe_Group.add(CTops_Outline); Cafe_Group.add(CDress_Color); Cafe_Group.add(CDress_Outline); Cafe_Group.add(CHead); Cafe_Group.add(CEyes); Cafe_Group.add(CBlink); Cafe_Group.add(CAccess2); Cafe_Group.add(CHair); Cafe_Group.add(CAccess); Cafe_Group.add(CAccess_Bags); Cafe_Group.add(CAccess3); } Cafe_Group.x = 800; }, DollBedroom: function() { BBody = this.add.sprite(205,338,"body"); BBody.anchor.setTo(0.5,0.5); BHead = this.add.sprite(185,78,"head"); BHead.anchor.setTo(0.5,0.5); BEyes = this.add.sprite(176,82,"eyes"); BEyes.anchor.setTo(0.5,0.5); BBlink = this.add.sprite(177,85,"blink"); BBlink.anchor.setTo(0.5,0.5); BBlink.alpha = 0; this.game.time.events.add(2000,function() { BEyes.alpha = 0; BBlink_Tween = this.add.tween(BBlink).to({alpha: 1},100,Phaser.Easing.Linear.None,true); BBlink_Tween.onComplete.add(function() { var RandNum = Math.floor(Math.random()*(2 - 1 + 1)) + 1; var BBlinkTimer = 0; if(RandNum == 0 || RandNum == 2){BBlinkTimer = 4000;} if(RandNum == 1){BBlinkTimer = 2000;} this.game.time.events.add(50,function() { BEyes.alpha = 1; BBlink.alpha = 0; this.game.time.events.add(BBlinkTimer,function(){BBlink_Tween.start();BEyes.alpha = 0;},this); },this); },this); },this); BHair = this.add.sprite(199,105,"hair"); BHair.anchor.setTo(0.5,0.5); BHair.frame = bHair; BTops_Color = this.add.sprite(187,210,"tops_color"); BTops_Color.anchor.setTo(0.5,0.5); BTops_Color.frame = bTops; BTops_Color.tint = bTopsColor; BTops_Color.visible = bTopsVisible; BTops_Outline = this.add.sprite(BTops_Color.x+1,BTops_Color.y,"tops_outline"); BTops_Outline.anchor.setTo(0.5,0.5); BTops_Outline.frame = bTops; BTops_Outline.visible = bTopsVisible; BBottoms_Color = this.add.sprite(179,373,"bottoms_color"); BBottoms_Color.anchor.setTo(0.5,0.5); BBottoms_Color.frame = bBottoms; BBottoms_Color.tint = bBottomsColor; BBottoms_Color.visible = bBottomsVisible; BBottoms_Outline = this.add.sprite(BBottoms_Color.x-.5,BBottoms_Color.y,"bottoms_outline"); BBottoms_Outline.anchor.setTo(0.5,0.5); BBottoms_Outline.frame = bBottoms; BBottoms_Outline.visible = bBottomsVisible; BDress_Color = this.add.sprite(167,268,"dress_color"); BDress_Color.anchor.setTo(0.5,0.5); BDress_Color.frame = bDress; BDress_Color.tint = bDressColor; BDress_Color.visible = bDressVisible; BDress_Outline = this.add.sprite(BDress_Color.x-1,BDress_Color.y,"dress_outline"); BDress_Outline.anchor.setTo(0.5,0.5); BDress_Outline.frame = bDress; BDress_Outline.visible = bDressVisible; BShoes_Color = this.add.sprite(205,544,"shoes_color"); BShoes_Color.anchor.setTo(0.5,0.5); BShoes_Color.frame = bShoes; BShoes_Color.tint = bShoesColor; BShoes_Color.visible = bShoesVisible; BShoes_Outline = this.add.sprite(BShoes_Color.x,BShoes_Color.y,"shoes_outline"); BShoes_Outline.anchor.setTo(0.5,0.5); BShoes_Outline.frame = bShoes; BShoes_Outline.visible = bShoesVisible; BAccess = this.add.sprite(176,82,"access"); BAccess.anchor.setTo(0.5,0.5); BAccess.visible = bAccessVisible; BAccess_Bags = this.add.sprite(87,362,"access_bags"); BAccess_Bags.anchor.setTo(0.5,0.5); BAccess_Bags.frame = bAccessBags; BAccess_Bags.visible = bAccessBagsVisible; BAccess2 = this.add.sprite(190,151,"access2") BAccess2.anchor.setTo(0.5,0.5); BAccess2.visible = bAccessVisible2; BAccess3 = this.add.sprite(203,42,"access3"); BAccess3.anchor.setTo(0.5,0.5); BAccess3.visible = bAccessVisible3; Bedroom_Group = this.add.group(); if(bBottoms == 3 && bShoes == 0 || bBottoms == 3 && bShoes == 1 || bBottoms == 3 && bShoes == 4 || bBottoms == 3 && bShoes == 5) { Bedroom_Group.add(BBody); Bedroom_Group.add(BShoes_Color); Bedroom_Group.add(BShoes_Outline); Bedroom_Group.add(BBottoms_Color); Bedroom_Group.add(BBottoms_Outline); Bedroom_Group.add(BTops_Color); Bedroom_Group.add(BTops_Outline); Bedroom_Group.add(BDress_Color); Bedroom_Group.add(BDress_Outline); Bedroom_Group.add(BHead); Bedroom_Group.add(BEyes); Bedroom_Group.add(BBlink); Bedroom_Group.add(BAccess2); Bedroom_Group.add(BHair); Bedroom_Group.add(BAccess); Bedroom_Group.add(BAccess_Bags); Bedroom_Group.add(BAccess3); } else { Bedroom_Group.add(BBody); Bedroom_Group.add(BBottoms_Color); Bedroom_Group.add(BBottoms_Outline); Bedroom_Group.add(BShoes_Color); Bedroom_Group.add(BShoes_Outline); Bedroom_Group.add(BTops_Color); Bedroom_Group.add(BTops_Outline); Bedroom_Group.add(BDress_Color); Bedroom_Group.add(BDress_Outline); Bedroom_Group.add(BHead); Bedroom_Group.add(BEyes); Bedroom_Group.add(BBlink); Bedroom_Group.add(BAccess2); Bedroom_Group.add(BHair); Bedroom_Group.add(BAccess); Bedroom_Group.add(BAccess_Bags); Bedroom_Group.add(BAccess3); } Bedroom_Group.x = 800; }, Next_fnc: function() { if(page == 1) { page++; Prev_Arrow.visible = true; this.add.tween(School_Group).to({x:-800},300,Phaser.Easing.Linear.None,true); this.add.tween(School_Bg).to({x:-800},300,Phaser.Easing.Linear.None,true); this.add.tween(Cafe_Group).to({x:200},300,Phaser.Easing.Linear.None,true); this.add.tween(Cafe_Bg).to({x:0},300,Phaser.Easing.Linear.None,true); } else if(page == 2) { page++; Next_Arrow.visible = false; this.add.tween(Cafe_Group).to({x:-800},300,Phaser.Easing.Linear.None,true); this.add.tween(Cafe_Bg).to({x:-800},300,Phaser.Easing.Linear.None,true); this.add.tween(Bedroom_Group).to({x:200},300,Phaser.Easing.Linear.None,true); this.add.tween(Bedroom_Bg).to({x:0},300,Phaser.Easing.Linear.None,true); } else if(page == 3){ page = 3; } }, Prev_fnc: function() { if(page == 1){ page = 1; } else if(page == 2) { page--; Prev_Arrow.visible = false; this.add.tween(School_Group).to({x:200},300,Phaser.Easing.Linear.None,true); this.add.tween(School_Bg).to({x:0},300,Phaser.Easing.Linear.None,true); this.add.tween(Cafe_Group).to({x:800},300,Phaser.Easing.Linear.None,true); this.add.tween(Cafe_Bg).to({x:800},300,Phaser.Easing.Linear.None,true); } else if(page == 3) { page--; Next_Arrow.visible = true; this.add.tween(Cafe_Group).to({x:200},300,Phaser.Easing.Linear.None,true); this.add.tween(Cafe_Bg).to({x:0},300,Phaser.Easing.Linear.None,true); this.add.tween(Bedroom_Group).to({x:800},300,Phaser.Easing.Linear.None,true); this.add.tween(Bedroom_Bg).to({x:800},300,Phaser.Easing.Linear.None,true); } }, update: function() { console.log(page) }, }