-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f7da56
commit 98b7e53
Showing
6 changed files
with
874 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Basket Random</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> | ||
|
||
<meta name="generator" content="Scirra Construct"> | ||
<meta name="author" content="RHM Interactive"> | ||
<meta name="description" content="Basket Random - Twoplayergames.org"> | ||
<link rel="manifest" href="appmanifest.json"> | ||
<script src="/js/all.js"></script> | ||
|
||
|
||
|
||
<link rel="stylesheet" href="style.css"> | ||
<script> | ||
window.addEventListener("keydown", function(e) { | ||
// space and arrow keys | ||
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) { | ||
e.preventDefault(); | ||
} | ||
}, false); | ||
</script> | ||
|
||
<script> | ||
const adBreak = adConfig = function(o) {return;} | ||
|
||
function initSDK() { | ||
// Game start logic | ||
let adConfigPromise = | ||
new Promise((resolve, reject) => adConfig({ | ||
preloadAdBreaks: 'on', | ||
onReady: () => resolve(true) | ||
})); | ||
let timeoutPromise = | ||
new Promise((resolve, reject) => { | ||
setTimeout(() => { | ||
console.log("Ad timeout"); | ||
resolve(false); | ||
}, 2000); | ||
}); | ||
// Whatever happens first resolves this promise. | ||
Promise.race([ | ||
adConfigPromise, | ||
timeoutPromise | ||
]).then((shouldShowPreRoll) => { | ||
if (shouldShowPreRoll) { | ||
showPreRoll(); | ||
} else { | ||
console.log("start game called"); | ||
c3_callFunction("startGame"); | ||
} | ||
}); | ||
} | ||
|
||
function showPreRoll() { | ||
// Show ad | ||
adBreak({ | ||
type: 'start', | ||
adBreakDone: function () { | ||
console.log("start game called"); | ||
c3_callFunction("startGame"); | ||
}, // always called, unblocks the game logic | ||
}); | ||
} | ||
</script> | ||
|
||
<script> | ||
function CallInterstitialAds() | ||
{ | ||
adBreak({ | ||
type: 'next', | ||
name: 'restart-game', | ||
beforeAd: () => { | ||
console.log("Ad Started!"); | ||
c3_callFunction("adStarted"); | ||
}, | ||
afterAd: () => { | ||
c3_callFunction("onClose"); | ||
console.log("After Ad Finished"); | ||
}, | ||
adBreakDone: () => { | ||
console.log('adBreakDone'); | ||
c3_callFunction("onClose"); | ||
} | ||
}); | ||
} | ||
|
||
var rewardReadyShowAds = null; | ||
function CallRewardedAds() { | ||
adBreak({ | ||
type: "reward", | ||
name: "extra_life_skin", | ||
beforeReward: (showAdFn) => { | ||
rewardReadyShowAds = showAdFn; | ||
|
||
if (this.rewardReadyShowAds) { | ||
c3_callFunction("adStarted"); | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(true); | ||
this.rewardReadyShowAds(); | ||
} | ||
}, | ||
adViewed: () => { | ||
rewardReadyShowAds = null; | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedAdFinished"); | ||
console.log('Rewarded Success!'); | ||
}, | ||
adDismissed: () => { | ||
rewardReadyShowAds = null; | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedFailed"); | ||
console.log('Rewarded Dismissed!'); | ||
}, | ||
adBreakDone: (placementInfo) => { | ||
switch (placementInfo.breakStatus) { | ||
case 'notReady': | ||
console.log('Ad Placement API not ready'); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedFailed"); | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
|
||
break; | ||
|
||
case 'timeout': | ||
console.log('Ad Placement API timeout'); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedFailed"); | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
|
||
break; | ||
|
||
case 'invalid': | ||
console.log('Invalid placement'); | ||
break; | ||
|
||
case 'error': | ||
console.log('Error in adBreak callback'); | ||
break; | ||
|
||
case 'noAdPreloaded': | ||
console.log('No ad preloaded'); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedFailed"); | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
|
||
break; | ||
|
||
case 'frequencyCapped': | ||
console.log('Frequency capped'); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedFailed"); | ||
c3_callFunction("FrequencyWarning"); | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
|
||
break; | ||
|
||
case 'ignored': | ||
console.log('User ignored the reward prompt'); | ||
break; | ||
|
||
case 'other': | ||
console.log('Ad not shown for another reason'); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedFailed"); | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
|
||
break; | ||
|
||
case 'dismissed': | ||
console.log('User dismissed the rewarded ad'); | ||
c3_callFunction("onClose"); | ||
c3_callFunction("rewardedFailed"); | ||
c3_runtimeInterface._GetLocalRuntime().SetSuspended(false); | ||
|
||
break; | ||
|
||
case 'viewed': | ||
console.log('Rewarded ad viewed'); | ||
break; | ||
|
||
default: | ||
console.log('Unknown break status'); | ||
break; | ||
} | ||
} | ||
}); | ||
} | ||
</script> | ||
|
||
</head> | ||
<body> | ||
|
||
<script> | ||
if (location.protocol.substr(0, 4) === "file") | ||
{ | ||
alert("Web exports won't work until you upload them. (When running on the file: protocol, browsers block many features from working for security reasons.)"); | ||
} | ||
</script> | ||
<script src="box2d.wasm.js"></script> | ||
<noscript> | ||
<div id="notSupportedWrap"> | ||
<h2 id="notSupportedTitle">This content requires JavaScript</h2> | ||
<p class="notSupportedMessage">JavaScript appears to be disabled. Please enable it to view this content.</p> | ||
</div> | ||
</noscript> | ||
<script src="scripts/supportcheck.js"></script> | ||
<script src="scripts/offlineclient.js" type="module"></script> | ||
<script src="scripts/main.js" type="module"></script> | ||
<script src="scripts/register-sw.js" type="module"></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
html, body { | ||
padding: 0; | ||
margin: 0; | ||
overflow: hidden; | ||
|
||
background: #000000; | ||
color: white; | ||
} | ||
|
||
html, body, canvas { | ||
touch-action: none; | ||
touch-action-delay: none; | ||
} | ||
|
||
#notSupportedWrap { | ||
margin: 2em auto 1em auto; | ||
width: 75%; | ||
max-width: 45em; | ||
border: 2px solid #aaa; | ||
border-radius: 1em; | ||
padding: 2em; | ||
background-color: #f0f0f0; | ||
font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; | ||
color: black; | ||
} | ||
|
||
#notSupportedTitle { | ||
font-size: 1.8em; | ||
} | ||
|
||
.notSupportedMessage { | ||
font-size: 1.2em; | ||
} | ||
|
||
.notSupportedMessage em { | ||
color: #888; | ||
} | ||
|
||
/* bbcode styles */ | ||
.bbCodeH1 { | ||
font-size: 2em; | ||
font-weight: bold; | ||
} | ||
|
||
.bbCodeH2 { | ||
font-size: 1.5em; | ||
font-weight: bold; | ||
} | ||
|
||
.bbCodeH3 { | ||
font-size: 1.25em; | ||
font-weight: bold; | ||
} | ||
|
||
.bbCodeH4 { | ||
font-size: 1.1em; | ||
font-weight: bold; | ||
} | ||
|
||
.bbCodeItem::before { | ||
content: " • "; | ||
} | ||
|
||
/* For text icons converted to HTML: size the height to the line height | ||
preserving the aspect ratio. Also add position: relative as that allows | ||
just adding a 'top' style for the iconoffsety style. */ | ||
.c3-text-icon { | ||
height: 1em; | ||
width: auto; | ||
position: relative; | ||
} | ||
|
||
/* screen reader text */ | ||
.c3-screen-reader-text { | ||
position: absolute; | ||
width: 1px; | ||
height: 1px; | ||
overflow: hidden; | ||
clip: rect(1px, 1px, 1px, 1px); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.