added geometry vibes to config.jsonc, added geometry vibes x-ball and geometry vibes monster
This commit is contained in:
@@ -410,6 +410,21 @@
|
||||
"aliases": [],
|
||||
"categories": []
|
||||
},
|
||||
"Geometry Vibes": {
|
||||
"path": "geometry-vibes",
|
||||
"aliases": [],
|
||||
"categories": []
|
||||
},
|
||||
"Geometry Vibes Monster": {
|
||||
"path": "geometry-vibes-monster",
|
||||
"aliases": [],
|
||||
"categories": []
|
||||
},
|
||||
"Geometry Vibes X-Ball": {
|
||||
"path": "geometry-vibes-x-ball",
|
||||
"aliases": [],
|
||||
"categories": []
|
||||
},
|
||||
"Getaway Shootout": {
|
||||
"path": "getaway-shootout",
|
||||
"aliases": [],
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 123 KiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "GvG2020_2+FullResponsive",
|
||||
"description": "Template with orientation selection",
|
||||
"version": "1.0",
|
||||
"category": "Custom",
|
||||
"customOptions": [
|
||||
{
|
||||
"name": "orientation",
|
||||
"label": "Screen Orientation",
|
||||
"tooltip": "Select the desired screen orientation",
|
||||
"type": "enum",
|
||||
"default": "Landscape",
|
||||
"enumValues": [
|
||||
"Portrait",
|
||||
"Landscape",
|
||||
"Both"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 426 KiB |
@@ -0,0 +1,230 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Geometry Vibes Monster</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
background-image: url("Build/Build.jpg");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
div#gameContainer {
|
||||
background: transparent !important;
|
||||
position: absolute;
|
||||
top: 0px !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
left: 0px !important;
|
||||
}
|
||||
|
||||
div#gameContainer canvas {
|
||||
position: absolute;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
div#gameContainer canvas[data-pixel-art="true"] {
|
||||
position: absolute;
|
||||
image-rendering: optimizeSpeed;
|
||||
image-rendering: -webkit-crisp-edges;
|
||||
image-rendering: -moz-crisp-edges;
|
||||
image-rendering: -o-crisp-edges;
|
||||
image-rendering: crisp-edges;
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
image-rendering: optimize-contrast;
|
||||
image-rendering: pixelated;
|
||||
-ms-interpolation-mode: nearest-neighbor;
|
||||
}
|
||||
|
||||
.loadingOut {
|
||||
width: 40%;
|
||||
max-width: 400px;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
border-radius: 10px;
|
||||
height: 15px;
|
||||
background: #e0e0e0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: repeating-linear-gradient(
|
||||
45deg,
|
||||
#4CAF50,
|
||||
#4CAF50 10px,
|
||||
#8BC34A 10px,
|
||||
#8BC34A 20px
|
||||
);
|
||||
border-radius: 10px;
|
||||
transition: width 0.2s ease;
|
||||
}
|
||||
|
||||
.centered {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -150px;
|
||||
margin-left: -250px;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
#orientation-warning {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: red;
|
||||
color: white;
|
||||
padding: 20px;
|
||||
border: 2px solid white;
|
||||
text-align: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#orientation-image {
|
||||
width: 125px;
|
||||
height: 125px;
|
||||
margin-top: 10px;
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: calc(50% - 150px);
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<img id="orientation-image" src="TemplateData/Orientation/orientation.png" alt="Orientation">
|
||||
<div id="orientation-warning">
|
||||
<div>Please rotate your device to the correct mode.</div>
|
||||
|
||||
</div>
|
||||
<div id="gameContainer">
|
||||
<img src="TemplateData/logo.png" class="centered">
|
||||
<div class="loadingOut">
|
||||
<div class="progress-bar" id="progress-bar"></div>
|
||||
</div>
|
||||
<canvas id="unity-canvas" data-pixel-art=""></canvas>
|
||||
<script src="Build/geometryVibes_SpaceV28.loader.js"></script>
|
||||
<script>
|
||||
var canvas = document.querySelector("#unity-canvas");
|
||||
var progressBar = document.querySelector("#progress-bar");
|
||||
var gameContainer = document.querySelector("#gameContainer");
|
||||
var orientationWarning = document.querySelector("#orientation-warning");
|
||||
var orientationImage = document.querySelector("#orientation-image");
|
||||
var config = {
|
||||
dataUrl: "Build/geometryVibes_SpaceV28.data.unityweb",
|
||||
frameworkUrl: "Build/geometryVibes_SpaceV28.framework.js.unityweb",
|
||||
codeUrl: "Build/geometryVibes_SpaceV28.wasm.unityweb",
|
||||
streamingAssetsUrl: "StreamingAssets",
|
||||
companyName: "GameVGames",
|
||||
productName: "Geometry Vibes Monster",
|
||||
productVersion: "1.0",
|
||||
};
|
||||
var scaleToFit;
|
||||
try {
|
||||
scaleToFit = !!JSON.parse("");
|
||||
} catch (e) {
|
||||
scaleToFit = true;
|
||||
}
|
||||
|
||||
function progressHandler(progress) {
|
||||
var percent = progress * 100 + '%';
|
||||
progressBar.style.width = percent;
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
var container = canvas.parentElement;
|
||||
var w;
|
||||
var h;
|
||||
|
||||
if (scaleToFit) {
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
|
||||
var r = 1080 / 1920;
|
||||
|
||||
if (w * r > window.innerHeight) {
|
||||
w = Math.min(w, Math.ceil(h / r));
|
||||
}
|
||||
h = Math.floor(w * r);
|
||||
} else {
|
||||
w = 1920;
|
||||
h = 1080;
|
||||
}
|
||||
|
||||
container.style.width = canvas.style.width = w + "px";
|
||||
container.style.height = canvas.style.height = h + "px";
|
||||
container.style.top = Math.floor((window.innerHeight - h) / 2) + "px";
|
||||
container.style.left = Math.floor((window.innerWidth - w) / 2) + "px";
|
||||
}
|
||||
|
||||
function checkOrientation(orientation) {
|
||||
if (orientation === "Portrait" && window.innerHeight < window.innerWidth) {
|
||||
orientationWarning.style.display = 'block';
|
||||
gameContainer.style.display = 'none';
|
||||
orientationWarning.innerText = 'Please rotate your device to portrait mode.';
|
||||
orientationImage.style.display = 'block'; // Ensure the image is visible
|
||||
} else if (orientation === "Landscape" && window.innerHeight > window.innerWidth) {
|
||||
orientationWarning.style.display = 'block';
|
||||
gameContainer.style.display = 'none';
|
||||
orientationWarning.innerText = 'Please rotate your device to landscape mode.';
|
||||
orientationImage.style.display = 'block'; // Ensure the image is visible
|
||||
} else {
|
||||
orientationWarning.style.display = 'none';
|
||||
gameContainer.style.display = 'block';
|
||||
orientationImage.style.display = 'none'; // Hide the image when not needed
|
||||
}
|
||||
}
|
||||
|
||||
function loadTemplateConfig() {
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('GET', 'TemplateData/Orientation/template.json', true);
|
||||
request.onreadystatechange = function() {
|
||||
if (request.readyState === 4 && request.status === 200) {
|
||||
var config = JSON.parse(request.responseText);
|
||||
var orientation = config.customOptions.find(option => option.name === "orientation").default;
|
||||
checkOrientation(orientation);
|
||||
}
|
||||
};
|
||||
request.send();
|
||||
}
|
||||
|
||||
createUnityInstance(canvas, config, progressHandler).then(function(instance) {
|
||||
canvas = instance.Module.canvas;
|
||||
myGameInstance = instance;
|
||||
onResize();
|
||||
});
|
||||
|
||||
window.addEventListener('resize', function() {
|
||||
onResize();
|
||||
loadTemplateConfig();
|
||||
});
|
||||
|
||||
loadTemplateConfig();
|
||||
</script>
|
||||
|
||||
<!--RHM API-->
|
||||
<script type="text/javascript" src="js/rhmApi.js"></script>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,158 @@
|
||||
window.adsbygoogle = window.adsbygoogle || [];
|
||||
|
||||
const adBreak = adConfig = function (o) {
|
||||
adsbygoogle.push(o);
|
||||
}
|
||||
|
||||
var rewardReadyShowAds = null;
|
||||
|
||||
adConfig({
|
||||
preloadAdBreaks: 'on',
|
||||
sound: 'on',
|
||||
onReady: () => {
|
||||
console.log("AdConfig Ready");
|
||||
},
|
||||
});
|
||||
|
||||
function InitSDKJs() {
|
||||
// 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) => {
|
||||
console.log("start game called");
|
||||
LoadRewardedAdsJs();
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'InitSucceed', 'ca-pub-8349441957149316');
|
||||
});
|
||||
}
|
||||
|
||||
function CallInterstitialAdsJs() {
|
||||
console.log("Intersititial Ads")
|
||||
adBreak({
|
||||
type: 'next',
|
||||
name: 'restart-game',
|
||||
beforeAd: () => {
|
||||
console.log("Pause Game")
|
||||
pauseGameBeforeAds()
|
||||
},
|
||||
afterAd: () => {
|
||||
console.log("Resume Game - After Ad")
|
||||
}, // Resume Game
|
||||
adBreakDone: (placementInfo) => {
|
||||
console.log("AdBreak Completed - AdBreak Done");
|
||||
resumeGameAfterAds()
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function LoadRewardedAdsJs() {
|
||||
console.log("LoadRewardedAds");
|
||||
|
||||
adBreak({
|
||||
type: 'reward', // ad shows at the start of the next level
|
||||
name: 'extra-life',
|
||||
beforeAd: () => {
|
||||
},
|
||||
afterAd: () => {
|
||||
console.log("afterAd");
|
||||
},
|
||||
beforeReward: (showAdFn) => {
|
||||
console.log("beforeReward");
|
||||
|
||||
},
|
||||
adDismissed: () => {
|
||||
console.log("adDismissed");
|
||||
},
|
||||
adViewed: () => {
|
||||
console.log("adViewed");
|
||||
},
|
||||
adBreakDone: (placementInfo) => {
|
||||
console.log("adBreak complete ");
|
||||
console.log("Break Type = " + placementInfo.breakType);
|
||||
console.log("Break Name = " + placementInfo.breakName);
|
||||
console.log("Break Format = " + placementInfo.breakFormat);
|
||||
console.log("Break Status = " + placementInfo.breakStatus);
|
||||
|
||||
// Check the breakStatus and call the appropriate function
|
||||
if (placementInfo.breakStatus === "notReady" || placementInfo.breakStatus === "timeout" || placementInfo.breakStatus === "frequencyCapped" ||
|
||||
placementInfo.breakStatus === "error" || placementInfo.breakStatus === "noAdPreloaded" || placementInfo.breakStatus === "other") {
|
||||
RewardedAdsNotLoaded();
|
||||
}
|
||||
else {
|
||||
RewardedAdsLoaded();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function CallRewardedAdsJs() {
|
||||
console.log("Call Rewarded Ads");
|
||||
|
||||
adBreak({
|
||||
type: 'reward', // ad shows at the start of the next level
|
||||
name: 'extra-life',
|
||||
beforeAd: () => {
|
||||
console.log("beforeAd");
|
||||
pauseGameBeforeAds();
|
||||
}, // You may also want to mute the game's sound.
|
||||
afterAd: () => {
|
||||
console.log("afterAd");
|
||||
}, // resume the game flow.
|
||||
beforeReward: (showAdFn) => {
|
||||
console.log("beforeReward");
|
||||
showAdFn();
|
||||
},
|
||||
adDismissed: () => {
|
||||
console.log("adDismissed");
|
||||
RewardedAdsDismissed();
|
||||
},
|
||||
adViewed: () => {
|
||||
console.log("adViewed");
|
||||
RewardSuccessful();
|
||||
},
|
||||
adBreakDone: (placementInfo) => {
|
||||
console.log("adBreak complete ");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function RewardedAdsLoaded() {
|
||||
console.log("Rewarded Ads Available")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'isRewardedAdsLoaded', 'true');
|
||||
}
|
||||
|
||||
function RewardedAdsNotLoaded() {
|
||||
console.log("Rewarded Ads Not Available")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'isRewardedAdsLoaded', 'false');
|
||||
}
|
||||
|
||||
function RewardedAdsDismissed() {
|
||||
console.log("Reward Dismissed")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'RewardedAdsFailed');
|
||||
}
|
||||
|
||||
function RewardSuccessful() {
|
||||
console.log("gainReward")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'RewardedAdsSuccessfull');
|
||||
}
|
||||
|
||||
function pauseGameBeforeAds() {
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'pauseGame');
|
||||
}
|
||||
|
||||
function resumeGameAfterAds() {
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'resumeGame');
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 426 KiB |
@@ -0,0 +1,249 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Geometry Vibes X-Ball</title>
|
||||
<style>
|
||||
@import url('movavi-grotesque');
|
||||
|
||||
html,
|
||||
body {
|
||||
background-image: url("Build/Build.jpg");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
div#gameContainer {
|
||||
background: transparent !important;
|
||||
position: absolute;
|
||||
top: 0px !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
left: 0px !important;
|
||||
}
|
||||
|
||||
div#gameContainer canvas {
|
||||
position: absolute;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
div#gameContainer canvas[data-pixel-art="true"] {
|
||||
position: absolute;
|
||||
image-rendering: optimizeSpeed;
|
||||
image-rendering: -webkit-crisp-edges;
|
||||
image-rendering: -moz-crisp-edges;
|
||||
image-rendering: -o-crisp-edges;
|
||||
image-rendering: crisp-edges;
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
image-rendering: optimize-contrast;
|
||||
image-rendering: pixelated;
|
||||
-ms-interpolation-mode: nearest-neighbor;
|
||||
}
|
||||
|
||||
.loadingOut {
|
||||
width: 250px;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: calc(50% - 8px);
|
||||
transform: translate(-50%);
|
||||
border: 2px solid white;
|
||||
height: 14px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: linear-gradient(to right, white, white 0%, transparent 0%, transparent);
|
||||
}
|
||||
|
||||
.centered {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -150px;
|
||||
margin-left: -250px;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
#orientation-warning {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 55%;
|
||||
/*Yeni Eklendi*/
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
color: white;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
z-index: 1000;
|
||||
font-family: 'Movavi Grotesque', sans-serif;
|
||||
/*Yeni Eklendi*/
|
||||
font-size: 6vw;
|
||||
/*Yeni Eklendi*/
|
||||
line-height: 120%;
|
||||
/*Yeni Eklendi*/
|
||||
}
|
||||
|
||||
#orientation-image {
|
||||
margin-top: 10px;
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: calc(50% - 150px);
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
#orientation-bg-color {
|
||||
background-color: #250739;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="orientation-bg-color"></div>
|
||||
<img id="orientation-image" src="TemplateData/Orientation/orientation.png" alt="Orientation">
|
||||
<div id="orientation-warning">
|
||||
<div>Please rotate your device to the correct mode.</div>
|
||||
|
||||
</div>
|
||||
<div id="gameContainer">
|
||||
<img src="TemplateData/logo.png" class="centered">
|
||||
<div class="loadingOut">
|
||||
<div class="progress-bar" id="progress-bar"></div>
|
||||
</div>
|
||||
<canvas id="unity-canvas" data-pixel-art=""></canvas>
|
||||
<script src="Build/geometryball_v1_7.loader.js"></script>
|
||||
<script>
|
||||
var canvas = document.querySelector("#unity-canvas");
|
||||
var progressBar = document.querySelector("#progress-bar");
|
||||
var gameContainer = document.querySelector("#gameContainer");
|
||||
var orientationWarning = document.querySelector("#orientation-warning");
|
||||
var orientationImage = document.querySelector("#orientation-image");
|
||||
var orientationBG = document.querySelector("#orientation-bg-color"); //Yeni Eklendi
|
||||
var config = {
|
||||
dataUrl: "Build/geometryball_v1_7.data.unityweb",
|
||||
frameworkUrl: "Build/geometryball_v1_7.framework.js.unityweb",
|
||||
codeUrl: "Build/geometryball_v1_7.wasm.unityweb",
|
||||
streamingAssetsUrl: "StreamingAssets",
|
||||
companyName: "GameVGames",
|
||||
productName: "Geometry Vibes X-Ball",
|
||||
productVersion: "1.0",
|
||||
};
|
||||
var scaleToFit;
|
||||
try {
|
||||
scaleToFit = !!JSON.parse("");
|
||||
} catch (e) {
|
||||
scaleToFit = true;
|
||||
}
|
||||
|
||||
function progressHandler(progress) {
|
||||
var percent = progress * 100 + '%';
|
||||
progressBar.style.background = 'linear-gradient(to right, white, white ' + percent + ', transparent ' + percent + ', transparent)';
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
var container = canvas.parentElement;
|
||||
var w;
|
||||
var h;
|
||||
|
||||
if (scaleToFit) {
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
|
||||
var r = 1080 / 1920;
|
||||
|
||||
if (w * r > window.innerHeight) {
|
||||
w = Math.min(w, Math.ceil(h / r));
|
||||
}
|
||||
h = Math.floor(w * r);
|
||||
} else {
|
||||
w = 1920;
|
||||
h = 1080;
|
||||
}
|
||||
|
||||
container.style.width = canvas.style.width = w + "px";
|
||||
container.style.height = canvas.style.height = h + "px";
|
||||
container.style.top = Math.floor((window.innerHeight - h) / 2) + "px";
|
||||
container.style.left = Math.floor((window.innerWidth - w) / 2) + "px";
|
||||
}
|
||||
|
||||
|
||||
|
||||
function isMobile() {
|
||||
return /Mobi|Android/i.test(navigator.userAgent);
|
||||
}
|
||||
function checkOrientation(orientation) {
|
||||
if (!isMobile()) {
|
||||
// Eğer cihaz mobil değilse, hiçbir şey yapma.
|
||||
return;
|
||||
}
|
||||
if (orientation === "Portrait" && window.innerHeight < window.innerWidth) {
|
||||
orientationWarning.style.display = 'block';
|
||||
gameContainer.style.display = 'none';
|
||||
orientationWarning.innerText = 'Please rotate your device to portrait mode.';
|
||||
orientationImage.style.display = 'block'; // Ensure the image is visible
|
||||
} else if (orientation === "Landscape" && window.innerHeight > window.innerWidth) {
|
||||
orientationWarning.style.display = 'block';
|
||||
gameContainer.style.display = 'none';
|
||||
orientationWarning.innerText = 'Please rotate your device to landscape mode.';
|
||||
orientationImage.style.display = 'block'; // Ensure the image is visible
|
||||
} else {
|
||||
orientationWarning.style.display = 'none';
|
||||
gameContainer.style.display = 'block';
|
||||
orientationImage.style.display = 'none'; // Hide the image when not needed
|
||||
}
|
||||
}
|
||||
|
||||
function loadTemplateConfig() {
|
||||
if (!isMobile()) {
|
||||
// Eğer cihaz mobil değilse, hiçbir şey yapma.
|
||||
return;
|
||||
}
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('GET', 'TemplateData/Orientation/template.json', true);
|
||||
request.onreadystatechange = function () {
|
||||
if (request.readyState === 4 && request.status === 200) {
|
||||
var config = JSON.parse(request.responseText);
|
||||
var orientation = config.customOptions.find(option => option.name === "orientation").default;
|
||||
checkOrientation(orientation);
|
||||
}
|
||||
};
|
||||
request.send();
|
||||
}
|
||||
|
||||
createUnityInstance(canvas, config, progressHandler).then(function (instance) {
|
||||
canvas = instance.Module.canvas;
|
||||
myGameInstance = instance;
|
||||
onResize();
|
||||
});
|
||||
|
||||
window.addEventListener('resize', function () {
|
||||
onResize();
|
||||
loadTemplateConfig();
|
||||
});
|
||||
|
||||
loadTemplateConfig();
|
||||
</script>
|
||||
|
||||
<!--RHM API-->
|
||||
<script type="text/javascript" src="js/rhmApi.js"></script>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,158 @@
|
||||
window.adsbygoogle = window.adsbygoogle || [];
|
||||
|
||||
const adBreak = adConfig = function (o) {
|
||||
adsbygoogle.push(o);
|
||||
}
|
||||
|
||||
var rewardReadyShowAds = null;
|
||||
|
||||
adConfig({
|
||||
preloadAdBreaks: 'on',
|
||||
sound: 'on',
|
||||
onReady: () => {
|
||||
console.log("AdConfig Ready");
|
||||
},
|
||||
});
|
||||
|
||||
function InitSDKJs() {
|
||||
// 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) => {
|
||||
console.log("start game called");
|
||||
LoadRewardedAdsJs();
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'InitSucceed', 'ca-pub-8349441957149316');
|
||||
});
|
||||
}
|
||||
|
||||
function CallInterstitialAdsJs() {
|
||||
console.log("Intersititial Ads")
|
||||
adBreak({
|
||||
type: 'next',
|
||||
name: 'restart-game',
|
||||
beforeAd: () => {
|
||||
console.log("Pause Game")
|
||||
pauseGameBeforeAds()
|
||||
},
|
||||
afterAd: () => {
|
||||
console.log("Resume Game - After Ad")
|
||||
}, // Resume Game
|
||||
adBreakDone: (placementInfo) => {
|
||||
console.log("AdBreak Completed - AdBreak Done");
|
||||
resumeGameAfterAds()
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function LoadRewardedAdsJs() {
|
||||
console.log("LoadRewardedAds");
|
||||
|
||||
adBreak({
|
||||
type: 'reward', // ad shows at the start of the next level
|
||||
name: 'extra-life',
|
||||
beforeAd: () => {
|
||||
},
|
||||
afterAd: () => {
|
||||
console.log("afterAd");
|
||||
},
|
||||
beforeReward: (showAdFn) => {
|
||||
console.log("beforeReward");
|
||||
|
||||
},
|
||||
adDismissed: () => {
|
||||
console.log("adDismissed");
|
||||
},
|
||||
adViewed: () => {
|
||||
console.log("adViewed");
|
||||
},
|
||||
adBreakDone: (placementInfo) => {
|
||||
console.log("adBreak complete ");
|
||||
console.log("Break Type = " + placementInfo.breakType);
|
||||
console.log("Break Name = " + placementInfo.breakName);
|
||||
console.log("Break Format = " + placementInfo.breakFormat);
|
||||
console.log("Break Status = " + placementInfo.breakStatus);
|
||||
|
||||
// Check the breakStatus and call the appropriate function
|
||||
if (placementInfo.breakStatus === "notReady" || placementInfo.breakStatus === "timeout" || placementInfo.breakStatus === "frequencyCapped" ||
|
||||
placementInfo.breakStatus === "error" || placementInfo.breakStatus === "noAdPreloaded" || placementInfo.breakStatus === "other") {
|
||||
RewardedAdsNotLoaded();
|
||||
}
|
||||
else {
|
||||
RewardedAdsLoaded();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function CallRewardedAdsJs() {
|
||||
console.log("Call Rewarded Ads");
|
||||
|
||||
adBreak({
|
||||
type: 'reward', // ad shows at the start of the next level
|
||||
name: 'extra-life',
|
||||
beforeAd: () => {
|
||||
console.log("beforeAd");
|
||||
pauseGameBeforeAds();
|
||||
}, // You may also want to mute the game's sound.
|
||||
afterAd: () => {
|
||||
console.log("afterAd");
|
||||
}, // resume the game flow.
|
||||
beforeReward: (showAdFn) => {
|
||||
console.log("beforeReward");
|
||||
showAdFn();
|
||||
},
|
||||
adDismissed: () => {
|
||||
console.log("adDismissed");
|
||||
RewardedAdsDismissed();
|
||||
},
|
||||
adViewed: () => {
|
||||
console.log("adViewed");
|
||||
RewardSuccessful();
|
||||
},
|
||||
adBreakDone: (placementInfo) => {
|
||||
console.log("adBreak complete ");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function RewardedAdsLoaded() {
|
||||
console.log("Rewarded Ads Available")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'isRewardedAdsLoaded', 'true');
|
||||
}
|
||||
|
||||
function RewardedAdsNotLoaded() {
|
||||
console.log("Rewarded Ads Not Available")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'isRewardedAdsLoaded', 'false');
|
||||
}
|
||||
|
||||
function RewardedAdsDismissed() {
|
||||
console.log("Reward Dismissed")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'RewardedAdsFailed');
|
||||
}
|
||||
|
||||
function RewardSuccessful() {
|
||||
console.log("gainReward")
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'RewardedAdsSuccessfull');
|
||||
}
|
||||
|
||||
function pauseGameBeforeAds() {
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'pauseGame');
|
||||
}
|
||||
|
||||
function resumeGameAfterAds() {
|
||||
myGameInstance.SendMessage('RHMAdsManager', 'resumeGame');
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
@font-face {
|
||||
font-family: 'Movavi Grotesque';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
src: local('Movavi Grotesque'), url('https://fonts.cdnfonts.com/s/18513/Movavi Grotesque Black Italic.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Movavi Grotesque';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
src: local('Movavi Grotesque'), url('https://fonts.cdnfonts.com/s/18513/Movavi Grotesque Black.woff') format('woff');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user