Skip to content

Commit afdf0ac

Browse files
author
avscs
committed
added geometry vibes to config.jsonc, added geometry vibes x-ball and geometry vibes monster
1 parent fb75f09 commit afdf0ac

21 files changed

+846
-0
lines changed

config.jsonc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,21 @@
410410
"aliases": [],
411411
"categories": []
412412
},
413+
"Geometry Vibes": {
414+
"path": "geometry-vibes",
415+
"aliases": [],
416+
"categories": []
417+
},
418+
"Geometry Vibes Monster": {
419+
"path": "geometry-vibes-monster",
420+
"aliases": [],
421+
"categories": []
422+
},
423+
"Geometry Vibes X-Ball": {
424+
"path": "geometry-vibes-x-ball",
425+
"aliases": [],
426+
"categories": []
427+
},
413428
"Getaway Shootout": {
414429
"path": "getaway-shootout",
415430
"aliases": [],
123 KB
Loading
Binary file not shown.
Binary file not shown.

games/geometry-vibes-monster/Build/geometryVibes_SpaceV28.loader.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
15.8 KB
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "GvG2020_2+FullResponsive",
3+
"description": "Template with orientation selection",
4+
"version": "1.0",
5+
"category": "Custom",
6+
"customOptions": [
7+
{
8+
"name": "orientation",
9+
"label": "Screen Orientation",
10+
"tooltip": "Select the desired screen orientation",
11+
"type": "enum",
12+
"default": "Landscape",
13+
"enumValues": [
14+
"Portrait",
15+
"Landscape",
16+
"Both"
17+
]
18+
}
19+
]
20+
}
426 KB
Loading
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7+
<title>Geometry Vibes Monster</title>
8+
<style>
9+
html,
10+
body {
11+
background-image: url("Build/Build.jpg");
12+
background-position: center;
13+
background-repeat: no-repeat;
14+
background-size: cover;
15+
width: 100%;
16+
height: 100%;
17+
overflow: visible;
18+
padding: 0;
19+
margin: 0;
20+
background-color: black;
21+
}
22+
23+
div#gameContainer {
24+
background: transparent !important;
25+
position: absolute;
26+
top: 0px !important;
27+
width: 100% !important;
28+
height: 100% !important;
29+
left: 0px !important;
30+
}
31+
32+
div#gameContainer canvas {
33+
position: absolute;
34+
width: 100% !important;
35+
height: 100% !important;
36+
}
37+
38+
div#gameContainer canvas[data-pixel-art="true"] {
39+
position: absolute;
40+
image-rendering: optimizeSpeed;
41+
image-rendering: -webkit-crisp-edges;
42+
image-rendering: -moz-crisp-edges;
43+
image-rendering: -o-crisp-edges;
44+
image-rendering: crisp-edges;
45+
image-rendering: -webkit-optimize-contrast;
46+
image-rendering: optimize-contrast;
47+
image-rendering: pixelated;
48+
-ms-interpolation-mode: nearest-neighbor;
49+
}
50+
51+
.loadingOut {
52+
width: 40%;
53+
max-width: 400px;
54+
position: fixed;
55+
left: 50%;
56+
top: 50%;
57+
transform: translate(-50%, -50%);
58+
border-radius: 10px;
59+
height: 15px;
60+
background: #e0e0e0;
61+
overflow: hidden;
62+
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
63+
}
64+
65+
.progress-bar {
66+
height: 100%;
67+
background: repeating-linear-gradient(
68+
45deg,
69+
#4CAF50,
70+
#4CAF50 10px,
71+
#8BC34A 10px,
72+
#8BC34A 20px
73+
);
74+
border-radius: 10px;
75+
transition: width 0.2s ease;
76+
}
77+
78+
.centered {
79+
position: fixed;
80+
top: 50%;
81+
left: 50%;
82+
margin-top: -150px;
83+
margin-left: -250px;
84+
width: 500px;
85+
}
86+
87+
#orientation-warning {
88+
display: none;
89+
position: fixed;
90+
top: 50%;
91+
left: 50%;
92+
transform: translate(-50%, -50%);
93+
background-color: red;
94+
color: white;
95+
padding: 20px;
96+
border: 2px solid white;
97+
text-align: center;
98+
z-index: 1000;
99+
}
100+
101+
#orientation-image {
102+
width: 125px;
103+
height: 125px;
104+
margin-top: 10px;
105+
display: none;
106+
position: fixed;
107+
top: calc(50% - 150px);
108+
left: 50%;
109+
transform: translate(-50%, -50%);
110+
}
111+
</style>
112+
</head>
113+
114+
<body>
115+
<img id="orientation-image" src="TemplateData/Orientation/orientation.png" alt="Orientation">
116+
<div id="orientation-warning">
117+
<div>Please rotate your device to the correct mode.</div>
118+
119+
</div>
120+
<div id="gameContainer">
121+
<img src="TemplateData/logo.png" class="centered">
122+
<div class="loadingOut">
123+
<div class="progress-bar" id="progress-bar"></div>
124+
</div>
125+
<canvas id="unity-canvas" data-pixel-art=""></canvas>
126+
<script src="Build/geometryVibes_SpaceV28.loader.js"></script>
127+
<script>
128+
var canvas = document.querySelector("#unity-canvas");
129+
var progressBar = document.querySelector("#progress-bar");
130+
var gameContainer = document.querySelector("#gameContainer");
131+
var orientationWarning = document.querySelector("#orientation-warning");
132+
var orientationImage = document.querySelector("#orientation-image");
133+
var config = {
134+
dataUrl: "Build/geometryVibes_SpaceV28.data.unityweb",
135+
frameworkUrl: "Build/geometryVibes_SpaceV28.framework.js.unityweb",
136+
codeUrl: "Build/geometryVibes_SpaceV28.wasm.unityweb",
137+
streamingAssetsUrl: "StreamingAssets",
138+
companyName: "GameVGames",
139+
productName: "Geometry Vibes Monster",
140+
productVersion: "1.0",
141+
};
142+
var scaleToFit;
143+
try {
144+
scaleToFit = !!JSON.parse("");
145+
} catch (e) {
146+
scaleToFit = true;
147+
}
148+
149+
function progressHandler(progress) {
150+
var percent = progress * 100 + '%';
151+
progressBar.style.width = percent;
152+
}
153+
154+
function onResize() {
155+
var container = canvas.parentElement;
156+
var w;
157+
var h;
158+
159+
if (scaleToFit) {
160+
w = window.innerWidth;
161+
h = window.innerHeight;
162+
163+
var r = 1080 / 1920;
164+
165+
if (w * r > window.innerHeight) {
166+
w = Math.min(w, Math.ceil(h / r));
167+
}
168+
h = Math.floor(w * r);
169+
} else {
170+
w = 1920;
171+
h = 1080;
172+
}
173+
174+
container.style.width = canvas.style.width = w + "px";
175+
container.style.height = canvas.style.height = h + "px";
176+
container.style.top = Math.floor((window.innerHeight - h) / 2) + "px";
177+
container.style.left = Math.floor((window.innerWidth - w) / 2) + "px";
178+
}
179+
180+
function checkOrientation(orientation) {
181+
if (orientation === "Portrait" && window.innerHeight < window.innerWidth) {
182+
orientationWarning.style.display = 'block';
183+
gameContainer.style.display = 'none';
184+
orientationWarning.innerText = 'Please rotate your device to portrait mode.';
185+
orientationImage.style.display = 'block'; // Ensure the image is visible
186+
} else if (orientation === "Landscape" && window.innerHeight > window.innerWidth) {
187+
orientationWarning.style.display = 'block';
188+
gameContainer.style.display = 'none';
189+
orientationWarning.innerText = 'Please rotate your device to landscape mode.';
190+
orientationImage.style.display = 'block'; // Ensure the image is visible
191+
} else {
192+
orientationWarning.style.display = 'none';
193+
gameContainer.style.display = 'block';
194+
orientationImage.style.display = 'none'; // Hide the image when not needed
195+
}
196+
}
197+
198+
function loadTemplateConfig() {
199+
var request = new XMLHttpRequest();
200+
request.open('GET', 'TemplateData/Orientation/template.json', true);
201+
request.onreadystatechange = function() {
202+
if (request.readyState === 4 && request.status === 200) {
203+
var config = JSON.parse(request.responseText);
204+
var orientation = config.customOptions.find(option => option.name === "orientation").default;
205+
checkOrientation(orientation);
206+
}
207+
};
208+
request.send();
209+
}
210+
211+
createUnityInstance(canvas, config, progressHandler).then(function(instance) {
212+
canvas = instance.Module.canvas;
213+
myGameInstance = instance;
214+
onResize();
215+
});
216+
217+
window.addEventListener('resize', function() {
218+
onResize();
219+
loadTemplateConfig();
220+
});
221+
222+
loadTemplateConfig();
223+
</script>
224+
225+
<!--RHM API-->
226+
<script type="text/javascript" src="js/rhmApi.js"></script>
227+
</div>
228+
</body>
229+
230+
</html>

0 commit comments

Comments
 (0)