1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Prepare for the release on gamedistribution

This commit is contained in:
tobspr
2020-05-22 13:12:07 +02:00
parent b3a2e869d1
commit ab5462e140
32 changed files with 375 additions and 243 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

View File

@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html>
<head>
<title>shapez.io</title>
<script type="text/javascript">
function postToGameFrame(msg) {
var handle = document.getElementById("gameframe");
if (handle) {
handle.contentWindow.postMessage(msg, "*");
}
}
window.addEventListener("message", function (event) {
if (event.data === "shapezio://gd.game_loaded") {
console.log("Game loaded");
}
if (event.data === "shapezio://gd.show_ad") {
console.log("Got ad message");
gdsdk.showAd();
}
});
window["GD_OPTIONS"] = {
gameId: "ac8e6fc04a6f46f990ac6a317bb4d74e",
onEvent: function (event) {
switch (event.name) {
case "SDK_GAME_START":
console.log("GDSDK: ad finished");
postToGameFrame("shapezio://gd.ad_finished");
setTimeout(function () {
document.getElementById("gameframe").focus();
console.log("(GD-PARENT_FRAME) successfully focused frame");
}, 500);
break;
case "SDK_GAME_PAUSE":
// pause game logic / mute audio
console.log("GDSDK: ad started");
postToGameFrame("shapezio://gd.ad_started");
break;
}
},
};
(function (d, s, id) {
var js,
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "https://html5.api.gamedistribution.com/main.min.js";
fjs.parentNode.insertBefore(js, fjs);
})(document, "script", "gamedistribution-jssdk");
</script>
<style>
body {
background: #222428;
text-align: center;
font-family: Arial;
color: #eee;
}
#gameframe {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
display: block;
z-index: 1;
}
</style>
</head>
<body style="background: #333;">
<iframe
onclick="this.focus()"
src="https://beta.shapez.io?embed=gamedistribution"
id="gameframe"
allowfullscreen
></iframe>
</body>
</html>

View File

@@ -0,0 +1,8 @@
{
"name": "shapez.io",
"short_name": "shapez.io",
"start_url": "index.html",
"display": "standalone",
"background_color": "#222428",
"description": "shapez.io"
}