better 60s burger run bc interstellar got blocked and no one has good one
BIN
60sburgerrun/assets/img/CoolmathGamesLogo.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
60sburgerrun/assets/img/angel.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
60sburgerrun/assets/img/bbTitle.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
60sburgerrun/assets/img/bg0.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
60sburgerrun/assets/img/bg1.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
60sburgerrun/assets/img/black.gif
Normal file
After Width: | Height: | Size: 162 B |
BIN
60sburgerrun/assets/img/brArwLeft.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
60sburgerrun/assets/img/brArwRight.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
60sburgerrun/assets/img/brArwUp.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
60sburgerrun/assets/img/bricks.gif
Normal file
After Width: | Height: | Size: 541 B |
BIN
60sburgerrun/assets/img/bricks101.gif
Normal file
After Width: | Height: | Size: 838 B |
BIN
60sburgerrun/assets/img/bricks102.gif
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
60sburgerrun/assets/img/bricks103.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
60sburgerrun/assets/img/bricks104.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
60sburgerrun/assets/img/btnFX.gif
Normal file
After Width: | Height: | Size: 872 B |
BIN
60sburgerrun/assets/img/btnHome.gif
Normal file
After Width: | Height: | Size: 645 B |
BIN
60sburgerrun/assets/img/btnMu.gif
Normal file
After Width: | Height: | Size: 860 B |
BIN
60sburgerrun/assets/img/btnPlay.gif
Normal file
After Width: | Height: | Size: 614 B |
BIN
60sburgerrun/assets/img/btnSettings.gif
Normal file
After Width: | Height: | Size: 799 B |
BIN
60sburgerrun/assets/img/burgerBar.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
60sburgerrun/assets/img/burgerBarGO.gif
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
60sburgerrun/assets/img/burgerLock.gif
Normal file
After Width: | Height: | Size: 374 B |
BIN
60sburgerrun/assets/img/bus.gif
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
60sburgerrun/assets/img/busStop.gif
Normal file
After Width: | Height: | Size: 701 B |
BIN
60sburgerrun/assets/img/c2c.gif
Normal file
After Width: | Height: | Size: 544 B |
BIN
60sburgerrun/assets/img/clock1.gif
Normal file
After Width: | Height: | Size: 182 B |
BIN
60sburgerrun/assets/img/clockBG.gif
Normal file
After Width: | Height: | Size: 530 B |
BIN
60sburgerrun/assets/img/cloudAni.gif
Normal file
After Width: | Height: | Size: 633 B |
BIN
60sburgerrun/assets/img/clouds.gif
Normal file
After Width: | Height: | Size: 157 B |
BIN
60sburgerrun/assets/img/goPlat.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
60sburgerrun/assets/img/goTL.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
60sburgerrun/assets/img/lbg3.gif
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
60sburgerrun/assets/img/lbg4.gif
Normal file
After Width: | Height: | Size: 701 B |
BIN
60sburgerrun/assets/img/lbg7.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
60sburgerrun/assets/img/lev1.gif
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
60sburgerrun/assets/img/lev2.gif
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
60sburgerrun/assets/img/lev3.gif
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
60sburgerrun/assets/img/lev4.gif
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
60sburgerrun/assets/img/lev5.gif
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
60sburgerrun/assets/img/lev6.gif
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
60sburgerrun/assets/img/lev7.gif
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
60sburgerrun/assets/img/loading1.gif
Normal file
After Width: | Height: | Size: 884 B |
BIN
60sburgerrun/assets/img/logoBR.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
60sburgerrun/assets/img/pauseBG.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
60sburgerrun/assets/img/plat.gif
Normal file
After Width: | Height: | Size: 154 B |
BIN
60sburgerrun/assets/img/preloadBar.gif
Normal file
After Width: | Height: | Size: 302 B |
BIN
60sburgerrun/assets/img/rotateDevice.gif
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
60sburgerrun/assets/img/spikes.gif
Normal file
After Width: | Height: | Size: 286 B |
BIN
60sburgerrun/assets/img/splatterBrick1.gif
Normal file
After Width: | Height: | Size: 147 B |
BIN
60sburgerrun/assets/img/splatterBrick2.gif
Normal file
After Width: | Height: | Size: 138 B |
BIN
60sburgerrun/assets/img/sprt.gif
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
60sburgerrun/assets/img/tuts.gif
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
60sburgerrun/assets/img/wellDone.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
60sburgerrun/assets/msc/muIngame.mp3
Normal file
BIN
60sburgerrun/assets/msc/muTitle.mp3
Normal file
BIN
60sburgerrun/assets/sfx/fxBus.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxClick.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxClose1.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxClose2.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxDD.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxFail.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxFall.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxHup.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxJump.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxLand.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxNom.wav
Normal file
BIN
60sburgerrun/assets/sfx/fxsplatterBrick.wav
Normal file
@ -1,35 +1,145 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XVTVBR1D5V"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-XVTVBR1D5V');
|
||||
</script>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>60s Burger Run</title>
|
||||
<style>html{background-color:#000;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="ruffle" width="100%" height="100%"></div>
|
||||
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>
|
||||
<script>
|
||||
window.RufflePlayer = window.RufflePlayer || {};
|
||||
window.addEventListener("load", (event) => {
|
||||
const ruffle = window.RufflePlayer.newest();
|
||||
const player = ruffle.createPlayer();
|
||||
const container = document.getElementById("ruffle");
|
||||
player.id = "player";
|
||||
player.style.width = "100%";
|
||||
player.style.height = "100%";
|
||||
container.appendChild(player);
|
||||
player.load("60sBurgerRun.swf");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="pragma" content="no-cache"/>
|
||||
<meta name ="viewport" content="width=512px, user-scalable=0, minimal-ui" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<title>60 Seconds Burger Run</title>
|
||||
<script type="text/javascript" src="js/phaser.js"></script>
|
||||
<script type="text/javascript" src="js/loader.js"></script>
|
||||
<script type="text/javascript" src="js/title.js"></script>
|
||||
<script type="text/javascript" src="js/level.js"></script>
|
||||
<script type="text/javascript" src="js/bus.js"></script>
|
||||
<script type="text/javascript" src="js/gameOver.js"></script>
|
||||
<script type="text/javascript">document.ontouchmove = function (e) {e.preventDefault();}</script>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-size:34px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
background: #000000;
|
||||
width: 512px;
|
||||
overflow-y: hidden;
|
||||
padding-bottom: 280px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style type="text/css">
|
||||
.no-select {
|
||||
-webkit-touch-callout: none; /* iOS Safari */
|
||||
-webkit-user-select: none; /* Safari */
|
||||
-khtml-user-select: none; /* Konqueror HTML */
|
||||
-moz-user-select: none; /* Old versions of Firefox */
|
||||
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||
user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
setTimeout(function(){
|
||||
if(document.getElementsByTagName("canvas").length) {
|
||||
document.getElementsByTagName("canvas")[0].classList.add("no-select")
|
||||
}
|
||||
}, 2000);
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function setUserAgent(window, userAgent) {
|
||||
// Works on Firefox, Chrome, Opera and IE9+
|
||||
if (navigator.__defineGetter__) {
|
||||
navigator.__defineGetter__("userAgent", function () {
|
||||
return userAgent;
|
||||
});
|
||||
} else if (Object.defineProperty) {
|
||||
Object.defineProperty(navigator, "userAgent", {
|
||||
get: function () {
|
||||
return userAgent;
|
||||
}
|
||||
});
|
||||
}
|
||||
// Works on Safari
|
||||
if (window.navigator.userAgent !== userAgent) {
|
||||
var userAgentProp = {
|
||||
get: function () {
|
||||
return userAgent;
|
||||
}
|
||||
};
|
||||
try {
|
||||
Object.defineProperty(window.navigator, "userAgent", userAgentProp);
|
||||
} catch (e) {
|
||||
window.navigator = Object.create(navigator, {
|
||||
userAgent: userAgentProp
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if(window.navigator.userAgent.indexOf("Safari")>=0 && "ontouchstart" in window && window.navigator.userAgent.indexOf("iPhone")== -1) {
|
||||
//var userAgent = window.navigator.userAgent.replace("Macintosh", "iPad");
|
||||
var userAgent = "Mozilla/5.0 (iPad; CPU OS 13_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.1 Mobile/15E148 Safari/604.1";
|
||||
setUserAgent(window,userAgent);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script> // my custom code
|
||||
document.onkeydown = keydown;
|
||||
|
||||
function keydown (evt) {
|
||||
|
||||
if (!evt) evt = event;
|
||||
|
||||
if (evt.key === "r" && !evt.altKey) {
|
||||
levl = 1;
|
||||
newState();
|
||||
tim = 0;
|
||||
|
||||
} else if (evt.altKey && evt.key === "r") {
|
||||
newState();
|
||||
tim = 0;
|
||||
|
||||
} else if (evt.altKey && evt.key === "q") {
|
||||
cheat = prompt("dev menu made by egamepass:\n1: level changer\n2. fps changer\n3. time go bye bye\n4. no clip\n5. get picked up")
|
||||
if(cheat == 1){
|
||||
levl = prompt("set levl (complete level)\nlevl 0 = title\n-9 = game over\n1-6 = levels");
|
||||
} else if(cheat == 2){
|
||||
world.time._desiredFps = prompt("what fps u want (default is 60)");
|
||||
} else if(cheat == 3){
|
||||
setInterval(() => {
|
||||
tim = 0;
|
||||
}, 700);
|
||||
|
||||
} else if(cheat == 4){
|
||||
setInterval(() => {
|
||||
spikes = "";
|
||||
}, 700);
|
||||
} else if(cheat == 5){
|
||||
callBus();
|
||||
} else {
|
||||
alert("idk what u want");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<script src="js/main.js"></script>
|
||||
<script>function fnSendMsg(evt){
|
||||
window.parent.postMessage('keypress-from-game', '*');
|
||||
}
|
||||
document.body.addEventListener('click', function(event) {
|
||||
fnSendMsg(event);
|
||||
});
|
||||
document.addEventListener('keypress', function(event) {
|
||||
fnSendMsg(event);
|
||||
});
|
||||
document.addEventListener('keydown', function (e) {
|
||||
fnSendMsg(event);
|
||||
});
|
||||
document.addEventListener('keyup', function (e) {
|
||||
fnSendMsg(event);
|
||||
});
|
||||
</script></body>
|
||||
</html>
|
||||
|
||||
|
1
60sburgerrun/js/bus.js
Normal file
@ -0,0 +1 @@
|
||||
var bus; function addBus(){bus = game.add.sprite(0, 0, 'bus'); bus.frame = 1; bus.position.setTo(sprt.x - 300, sprt.y + 30 - 400); bus.anchor.setTo(0.5,1); var angel; angel = bus.addChild(game.make.sprite(-40, -110, 'angel')); angel.animations.add('idle', null, 12); angel.play('idle',null,true); angel.anchor.setTo(0.5,1); angel.scale.x = -1; angel = bus.addChild(game.make.sprite(40, -110, 'angel')); angel.animations.add('idle', null, 12); angel.play('idle',null,true); angel.anchor.setTo(0.5,1); bus.stat = 'intro'; bus.fly = 'in'; game.camera.focusOnXY(sprt.x,sprt.y + 0); sprt.visible = false; sprt.noControl = true; sprt.xx = 0; bus.ct = 30; } function callBus(){bus.revive(); bus.position.setTo(sprt.x - 300, sprt.y + 30 - 400); bus.frame = 0; bus.stat = 'outro'; bus.fly = 'in'; bus.ct = 9; world.q = 0; } function busCode(){if(!bus.stat){return; } if(bus.ct > 0){bus.ct --; if(bus.ct == 7){fxPlay(sfx.fxBus);} return true; } if(bus.fly == 'in'){bus.xx = (sprt.x - bus.x) / 18; if(bus.xx < 7){bus.xx = 7; } bus.x += bus.xx; bus.yy = (sprt.y - bus.y + 40) / 8; bus.y += bus.yy; if(bus.x > sprt.x - 5){bus.fly = 'out'; bus.yy = -0.1; if(bus.stat == 'intro'){bus.frame = 0; sprt.visible = true; sprt.noControl = false; } if(bus.stat == 'outro'){bus.frame = 1; sprt.visible = false; } } return true; } if(bus.fly == 'out'){bus.x += bus.xx; bus.y += bus.yy; bus.xx += 0.4; bus.yy = bus.yy * 1.3; if(bus.yy < -12){bus.yy = -12; } if(bus.y < game.camera.y - 200){bus.yy = -12; bus.fly = null; if(bus.stat == 'intro'){bus.stat = null; bus.kill(); } if(bus.stat == 'outro'){world.doneCT = 999; } } } }
|
1
60sburgerrun/js/gameOver.js
Normal file
@ -0,0 +1 @@
|
||||
var GameOverState = {preload: function(){world = this; settings(this); game.stage.backgroundColor = "#FFFFFF"; }, create: function() {game.sound.stopAll(); world.fxFail = this.add.audio('fxFail'); world.fxClose1 = this.add.audio('fxClose1'); world.fxClose2 = this.add.audio('fxClose2'); fxPlay(world.fxFail); this.black = world.game.add.sprite(0,0, 'black'); this.black.fixedToCamera = true; this.bb = this.game.add.sprite(0,0, 'burgerBar'); this.bb.anchor.setTo(0.5, 1); var del = this.game.add.sprite(0,0, 'goPlat'); del.anchor.setTo(0.5, 0); this.burgerLock = this.game.add.sprite(0, -40, 'burgerLock'); this.burgerLock.anchor.setTo(0.5, 1); var del = this.game.add.sprite(0,0, 'burgerBarGO'); del.anchor.setTo(0.5, 1); game.world.setBounds(-99999,-99999,9999999,9999999); world.ct = 50; world.f = 0; world.fun = [goWait, goClose, goWait, goShowClick, goNull]; }, update: function(){goBG(); world.fun[world.f](); } }; function goClick(pointer){if(rotDevice){return;} if(parent && parent.cmgGameEvent){parent.cmgGameEvent('start'); } levl = 0; clickSound(); newState(); } function goBG(){world.black.width = game.camera.width; world.black.height = game.camera.height + 10; game.camera.focusOnXY(world.bb.x, world.bb.y - 15); } function goWait(){world.ct--; if(world.ct < 0){world.f++; world.ct = 0; if(world.f == 1){fxPlay(world.fxClose1); } } } function goClose(){world.burgerLock.y += 1.5; if(world.burgerLock.y > 0){world.burgerLock.y = 0; world.f++; fxPlay(world.fxClose2); var del = world.game.add.sprite(0,-40, 'goTL'); del.anchor.setTo(0.5, 1); world.ct = 80; } } function goShowClick(){var c2c = world.game.add.sprite(0,17, 'c2c'); c2c.animations.add('idle', null, 1); c2c.play('idle',null,true); c2c.anchor.setTo(0.5, 0); game.input.onDown.add(goClick); world.f++; } function goNull(){}
|
1
60sburgerrun/js/level.js
Normal file
1
60sburgerrun/js/loader.js
Normal file
@ -0,0 +1 @@
|
||||
var LoaderState = {preload: function(){game.renderer.renderSession.roundPixels = true; Phaser.Canvas.setImageRenderingCrisp(game.canvas); game.stage.smoothed = false; world = this; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; game.stage.backgroundColor = "#000000"; this.lode = this.add.sprite(this.game.world.centerX,this.game.world.centerY, 'loading1'); this.lode.anchor.setTo(0.5); this.preloadBar = this.add.sprite(this.game.world.centerX - 120, this.game.world.centerY, 'preloadBar'); this.preloadBar.anchor.setTo(0, 0.5); this.preloadBar.sendToBack(); this.lode.sendToBack(); this.load.setPreloadSprite(this.preloadBar); game.load.image('brArwUp', 'assets/img/brArwUp.png'); game.load.image('brArwLeft', 'assets/img/brArwLeft.png'); game.load.image('brArwRight', 'assets/img/brArwRight.png'); game.load.image('wellDone', 'assets/img/wellDone.png'); game.load.image('bricks', 'assets/img/bricks.gif'); game.load.image('bricks101', 'assets/img/bricks101.gif'); game.load.image('bricks102', 'assets/img/bricks102.gif'); game.load.image('bricks103', 'assets/img/bricks103.png'); game.load.image('bricks104', 'assets/img/bricks104.png'); game.load.image('busStop', 'assets/img/busStop.gif'); game.load.image('spikes', 'assets/img/spikes.gif'); game.load.image('burgerBar', 'assets/img/burgerBar.gif'); game.load.image('burgerBarGO', 'assets/img/burgerBarGO.gif'); game.load.image('burgerLock', 'assets/img/burgerLock.gif'); game.load.image('goPlat', 'assets/img/goPlat.gif'); game.load.image('splatterBrick1', 'assets/img/splatterBrick1.gif'); game.load.image('splatterBrick2', 'assets/img/splatterBrick2.gif'); game.load.image('lev1', 'assets/img/lev1.gif'); game.load.image('lev2', 'assets/img/lev2.gif'); game.load.image('lev3', 'assets/img/lev3.gif'); game.load.image('lev4', 'assets/img/lev4.gif'); game.load.image('lev5', 'assets/img/lev5.gif'); game.load.image('lev6', 'assets/img/lev6.gif'); game.load.image('lev7', 'assets/img/lev7.gif'); game.load.image('lbg3', 'assets/img/lbg3.gif'); game.load.image('lbg4', 'assets/img/lbg4.gif'); game.load.image('lbg7', 'assets/img/lbg7.gif'); game.load.image('clock1', 'assets/img/clock1.gif'); game.load.image('goTL', 'assets/img/goTL.gif'); game.load.image('clouds', 'assets/img/clouds.gif'); game.load.image('btnPlay2', 'assets/img/btnPlay.gif'); game.load.image('bbTitle', 'assets/img/bbTitle.png'); game.load.image('logoBR', 'assets/img/logoBR.png'); game.load.image('btnHome', 'assets/img/btnHome.gif'); game.load.spritesheet('clockBG', 'assets/img/clockBG.gif', 42, 42); game.load.spritesheet('c2c', 'assets/img/c2c.gif', 108, 55); game.load.spritesheet('btnMu', 'assets/img/btnMu.gif', 80, 80); game.load.spritesheet('btnFX', 'assets/img/btnFX.gif', 80, 80); game.load.spritesheet('btnSettings', 'assets/img/btnSettings.gif', 80, 80); game.load.spritesheet('sprt', 'assets/img/sprt.gif', 42, 42); game.load.spritesheet('cloudAni', 'assets/img/cloudAni.gif', 60, 60); game.load.spritesheet('tuts', 'assets/img/tuts.gif', 180, 70); game.load.spritesheet('bus', 'assets/img/bus.gif', 140, 120); game.load.spritesheet('angel', 'assets/img/angel.gif', 34, 32); game.load.image('bg0', 'assets/img/bg0.png'); game.load.audio('fxLand', 'assets/sfx/fxLand.wav'); game.load.audio('fxBus', 'assets/sfx/fxBus.wav'); game.load.audio('fxsplatterBrick', 'assets/sfx/fxsplatterBrick.wav'); game.load.audio('fxHup', 'assets/sfx/fxHup.wav'); game.load.audio('fxNom', 'assets/sfx/fxNom.wav'); game.load.audio('fxFall', 'assets/sfx/fxFall.wav'); game.load.audio('fxFail', 'assets/sfx/fxFail.wav'); game.load.audio('fxClose1', 'assets/sfx/fxClose1.wav'); game.load.audio('fxClose2', 'assets/sfx/fxClose2.wav'); game.load.audio('muTitle', 'assets/msc/muTitle.mp3'); game.load.audio('muIngame', 'assets/msc/muIngame.mp3'); game.load.audio('fxJump', 'assets/sfx/fxJump.wav'); game.load.audio('fxDD', 'assets/sfx/fxDD.wav'); game.load.audio('fxClick', 'assets/sfx/fxClick.wav'); game.load.image('plat', 'assets/img/plat.gif'); game.load.image('bg1', 'assets/img/bg1.png'); game.load.image('pauseBG', 'assets/img/pauseBG.png'); }, create: function() {world.lode.destroy(); world.preloadBar.destroy(); clickFX = game.add.audio('fxClick'); game.btnPlay = world.game.add.sprite(this.game.world.centerX,this.game.world.centerY, 'btnPlay2'); game.btnPlay.anchor.setTo(0.5, 0.5); game.btnPlay.sendToBack(); game.btnPlay.inputEnabled = true; game.btnPlay.events.onInputDown.add(startGame, this); var topURL = 'run';try {topURL = window.top.location.hostname.split(".").splice(-2).join('.');}catch(err) {} if(arr.indexOf(topURL) < 0){game.destroy();} }, update: function(){game.btnPlay.y = screenHeight / 2; } }; function startGame(pointer){if(parent && parent.cmgGameEvent){parent.cmgGameEvent('start'); } newState(); }
|
214
60sburgerrun/js/main.js
Normal file
@ -0,0 +1,214 @@
|
||||
var screenWidth = 512;
|
||||
var screenHeight = 288;
|
||||
var rotDevice;
|
||||
var world;
|
||||
var levl = 0;
|
||||
var mu;
|
||||
var vol = 1;
|
||||
var ld;
|
||||
var wait = 0;
|
||||
var clickFX;
|
||||
|
||||
function unlockAllLevels() {
|
||||
if (!game) {
|
||||
return;
|
||||
}
|
||||
game.ldat = 16;
|
||||
if (levl == -1) {
|
||||
newState();
|
||||
}
|
||||
}
|
||||
var MainState = {
|
||||
preload: function() {
|
||||
world = this;
|
||||
this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
|
||||
this.scale.pageAlignHorizontally = true;
|
||||
this.scale.pageAlignVertically = true;
|
||||
game.stage.backgroundColor = "#000000";
|
||||
game.load.image('black', 'assets/img/black.gif');
|
||||
game.load.image('rotateDevice', 'assets/img/rotateDevice.gif');
|
||||
game.load.image('loading1', 'assets/img/loading1.gif');
|
||||
game.load.image('preloadBar', 'assets/img/preloadBar.gif');
|
||||
},
|
||||
create: function() {
|
||||
game.splashCT = 60 * 3;
|
||||
storageAvailable();
|
||||
if (game.storageAvailable) {
|
||||
game.ldat = localStorage.getItem('ldat');
|
||||
}
|
||||
if (!game.ldat) {
|
||||
game.ldat = 1;
|
||||
}
|
||||
game.scale.onSizeChange.add(onSizeChange);
|
||||
game.scale.setResizeCallback(onSizeChange);
|
||||
onSizeChange();
|
||||
},
|
||||
update: function() {
|
||||
game.state.start('Loader');
|
||||
game.scale.onOrientationChange.add(oriChange, game);
|
||||
oriChange();
|
||||
}
|
||||
};
|
||||
|
||||
function oriChange(e) {
|
||||
var ori = 'landscape';
|
||||
if (game.scale.screenOrientation === 'portrait-primary' || game.scale.screenOrientation === 'portrait-secondary') {
|
||||
ori = 'portrait';
|
||||
}
|
||||
if (ori == 'landscape') {
|
||||
if (rotDevice) {
|
||||
rotDevice.destroy();
|
||||
rotDevice = null;
|
||||
}
|
||||
if (!game.keepPaused) {
|
||||
game.paused = false;
|
||||
muResume();
|
||||
}
|
||||
} else {
|
||||
game.keepPaused = null;
|
||||
if (game.paused) {
|
||||
game.keepPaused = true;
|
||||
}
|
||||
muPause();
|
||||
rotDevice = game.add.group();
|
||||
rotDevice.bg = rotDevice.create(0, 0, 'black');
|
||||
rotDevice.bg.anchor.setTo(0);
|
||||
rotDevice.bg.width = screenWidth;
|
||||
rotDevice.bg.height = screenHeight;
|
||||
rotDevice.rd = rotDevice.create(0, 0, 'rotateDevice');
|
||||
rotDevice.rd.anchor.setTo(0.5);
|
||||
rotDevice.rd.x = screenWidth / 2;
|
||||
rotDevice.rd.y = screenHeight / 2;
|
||||
game.paused = true;
|
||||
}
|
||||
}
|
||||
|
||||
function storageAvailable() {
|
||||
game.storageAvailable = true;
|
||||
if (typeof localStorage === 'object') {
|
||||
try {
|
||||
localStorage.setItem('localStorage', 1);
|
||||
localStorage.removeItem('localStorage');
|
||||
} catch (e) {
|
||||
Storage.prototype._setItem = Storage.prototype.setItem;
|
||||
Storage.prototype.setItem = function() {};
|
||||
game.storageAvailable = false;
|
||||
}
|
||||
} else {
|
||||
game.storageAvailable = false;
|
||||
}
|
||||
}
|
||||
|
||||
function newState() {
|
||||
game.paused = false;
|
||||
game.world.setBounds(0, 0, screenWidth, screenHeight);
|
||||
if (levl > 16) {
|
||||
levl = -9;
|
||||
}
|
||||
if (levl > 0) {
|
||||
game.state.start('Level');
|
||||
return;
|
||||
}
|
||||
if (levl == 0) {
|
||||
game.state.start('Title');
|
||||
return;
|
||||
}
|
||||
if (levl == -1) {
|
||||
game.state.start('LevelSelect');
|
||||
return;
|
||||
}
|
||||
if (levl == -9) {
|
||||
game.state.start('GameOver');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function click() {}
|
||||
|
||||
function setDimensionsDesktop() {
|
||||
if (window.innerWidth > window.innerHeight && window.innerWidth > 512 && window.innerWidth < 801) {
|
||||
screenWidth = window.innerWidth;
|
||||
screenHeight = Math.ceil(screenWidth / 16 * 9);
|
||||
}
|
||||
}
|
||||
setDimensionsDesktop();
|
||||
var game = new Phaser.Game(screenWidth, screenHeight, Phaser.AUTO);
|
||||
game.preserveDrawingBuffer = true;
|
||||
game.state.add('Main', MainState);
|
||||
game.state.add('Loader', LoaderState);
|
||||
game.state.add('Title', TitleState);
|
||||
game.state.add('Level', LevelState);
|
||||
game.state.add('GameOver', GameOverState);
|
||||
game.state.start('Main');
|
||||
|
||||
function settings(st) {
|
||||
st.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
|
||||
onSizeChange();
|
||||
st.scale.pageAlignHorizontally = true;
|
||||
st.scale.pageAlignVertically = true;
|
||||
game.stage.backgroundColor = "#000000";
|
||||
}
|
||||
|
||||
function onSizeChange() {
|
||||
prevScreenHeight = screenHeight;
|
||||
screenHeight = Math.ceil(screenWidth / window.innerWidth * window.innerHeight);
|
||||
if (prevScreenHeight != screenHeight) {
|
||||
game.scale.setGameSize(screenWidth, screenHeight);
|
||||
resetGamePad();
|
||||
if (rotDevice) {
|
||||
rotDevice.bg.width = screenWidth;
|
||||
rotDevice.bg.height = screenHeight;
|
||||
rotDevice.rd.x = screenWidth / 2;
|
||||
rotDevice.rd.y = screenHeight / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function muPlay(st, vol, loop) {
|
||||
var m = false;
|
||||
if (mu && mu.key != st) {
|
||||
var m = mu.mute;
|
||||
mu.stop();
|
||||
mu.destroy();
|
||||
mu = null;
|
||||
}
|
||||
if (!mu) {
|
||||
mu = game.add.audio(st);
|
||||
mu.loop = false;
|
||||
if (loop) {
|
||||
mu.loop = true;
|
||||
}
|
||||
mu.mute = m;
|
||||
mu.xVol = vol;
|
||||
game.sound.setDecodedCallback([mu], soundsDecoded, game);
|
||||
}
|
||||
}
|
||||
|
||||
function fxPlay(fx) {
|
||||
if (!game.muteFX) {
|
||||
fx.play();
|
||||
}
|
||||
}
|
||||
|
||||
function clickSound() {
|
||||
if (!game.muteFX) {
|
||||
clickFX.play();
|
||||
}
|
||||
}
|
||||
|
||||
function muPause() {
|
||||
if (mu) {
|
||||
mu.pause();
|
||||
}
|
||||
}
|
||||
|
||||
function muResume() {
|
||||
if (mu) {
|
||||
mu.resume();
|
||||
}
|
||||
}
|
||||
|
||||
function soundsDecoded() {
|
||||
mu.play(null, 0, vol * mu.xVol, mu.loop);
|
||||
setMuFXBtns();
|
||||
}
|
28
60sburgerrun/js/phaser.js
Normal file
1
60sburgerrun/js/title.js
Normal file
@ -0,0 +1 @@
|
||||
var TitleState = {preload: function(){world = this; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; game.stage.backgroundColor = "#000000"; }, create: function() {tim = 0; var logo = this.game.add.sprite(screenWidth / 2,0, 'logoBR'); logo.anchor.setTo(0.5, 0); world.titleClouds = game.add.tileSprite(logo.left + 5, 0, logo.width - 10, 115, 'clouds'); world.titleClouds.sendToBack(); sprt = this.game.add.sprite(logo.left + 34, 102, 'sprt'); sprt.animations.add('run', [5,6,7,8,9,10], 12, true); sprt.anchor.setTo(0.5, 1); sprt.play('run'); this.bb = this.game.add.sprite(logo.left - 60, screenHeight, 'bbTitle'); this.bb.anchor.setTo(0, 0.5); muPlay('muTitle',1,true); this.btnPlay = world.game.add.sprite(logo.right - 70, screenHeight - 60, 'btnPlay2'); this.btnPlay.anchor.setTo(0.5, 0.5); this.btnPlay.inputEnabled = true; this.btnPlay.events.onInputDown.add(gotoL1, this); game.btnMu = addButtonsTitle('btnMu',-120); game.btnFX = addButtonsTitle('btnFX',-200); setMuFXBtns(); game.input.onDown.add(muteButtons); }, update: function(){world.titleClouds.tilePosition.x -= 1.5; var midY = Math.ceil((screenHeight - 120) / 2) + 120; this.btnPlay.y = midY; game.btnMu.y = midY; game.btnFX.y = midY; this.bb.y = midY; } }; function addButtonsTitle(nam,xOff){var b = game.add.sprite(world.btnPlay.x + xOff, screenHeight - 60, nam); b.anchor.setTo(0.5, 0.5); b.inputEnabled = true; return b; } function gotoL1(){clickSound(); levl = 1; newState(); }
|