Skip to content

Commit

Permalink
Version 1.3.0 patch
Browse files Browse the repository at this point in the history
- Add custom levels
- Rewrite many things
- Add lots of assets
- Other things
  • Loading branch information
Vanilagy committed Oct 19, 2020
1 parent 09c0eff commit 326bb3a
Show file tree
Hide file tree
Showing 175 changed files with 2,876 additions and 607 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/node_modules
src/js/bundle.js
src/storage
dist
todo.txt
.rpt2_cache
Expand Down
1 change: 1 addition & 0 deletions src/assets/cla_list.json

Large diffs are not rendered by default.

Binary file added src/assets/data/interiors_mbp/mbp_hot8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/interiors_mbp/mbu_edge_white.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/interiors_mbp/mbu_edge_white2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/shapes/colmesh.dts
Binary file not shown.
7 changes: 7 additions & 0 deletions src/assets/data/skies/advanced/advanced_sky.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky_FR
sky_RT
sky_BK
sky_LF
sky_UP
sky_DN
enviro_map
Binary file added src/assets/data/skies/advanced/enviro_map.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/advanced/sky_bk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/advanced/sky_dn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/advanced/sky_fr.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/advanced/sky_lf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/advanced/sky_rt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/advanced/sky_up.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/atoll/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/atoll/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/atoll/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/atoll/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/atoll/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/atoll/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/atoll/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/data/skies/atoll/atoll.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2
3
4
1
5
6
7
7 changes: 7 additions & 0 deletions src/assets/data/skies/beginner/beginner_sky.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky_FR
sky_RT
sky_BK
sky_LF
sky_UP
sky_DN
enviro_map
Binary file added src/assets/data/skies/beginner/enviro_map.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/beginner/sky_bk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/beginner/sky_dn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/beginner/sky_fr.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/beginner/sky_lf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/beginner/sky_rt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/beginner/sky_up.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/bonus/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/data/skies/bonus/2.jpg
Binary file added src/assets/data/skies/bonus/3.jpg
Binary file added src/assets/data/skies/bonus/4.jpg
Binary file added src/assets/data/skies/bonus/5.jpg
Binary file added src/assets/data/skies/bonus/6.jpg
Binary file added src/assets/data/skies/bonus/7.jpg
7 changes: 7 additions & 0 deletions src/assets/data/skies/bonus/bonus_sky.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2
3
4
1
5
6
7
7 changes: 7 additions & 0 deletions src/assets/data/skies/cloudy/cloudy.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky-n
sky-e
sky-s
sky-w
sky-u
sky-d
sky-env
Binary file added src/assets/data/skies/cloudy/sky-d.png
Binary file added src/assets/data/skies/cloudy/sky-e.png
Binary file added src/assets/data/skies/cloudy/sky-env.png
Binary file added src/assets/data/skies/cloudy/sky-n.png
Binary file added src/assets/data/skies/cloudy/sky-s.png
Binary file added src/assets/data/skies/cloudy/sky-u.png
Binary file added src/assets/data/skies/cloudy/sky-w.png
Binary file added src/assets/data/skies/expert/enviro_map.jpg
7 changes: 7 additions & 0 deletions src/assets/data/skies/expert/expert_sky.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky_FR
sky_RT
sky_BK
sky_LF
sky_UP
sky_DN
enviro_map
Binary file added src/assets/data/skies/expert/sky_bk.jpg
Binary file added src/assets/data/skies/expert/sky_dn.jpg
Binary file added src/assets/data/skies/expert/sky_fr.jpg
Binary file added src/assets/data/skies/expert/sky_lf.jpg
Binary file added src/assets/data/skies/expert/sky_rt.jpg
Binary file added src/assets/data/skies/expert/sky_up.jpg
Binary file added src/assets/data/skies/icy water/1.png
Binary file added src/assets/data/skies/icy water/2.png
Binary file added src/assets/data/skies/icy water/3.png
Binary file added src/assets/data/skies/icy water/4.png
Binary file added src/assets/data/skies/icy water/5.png
Binary file added src/assets/data/skies/icy water/6.png
Binary file added src/assets/data/skies/icy water/7.png
7 changes: 7 additions & 0 deletions src/assets/data/skies/icy water/icy water.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2
3
4
1
5
6
7
7 changes: 7 additions & 0 deletions src/assets/data/skies/intermediate/intermediate_sky.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky_FR
sky_RT
sky_BK
sky_LF
sky_UP
sky_DN
enviro_map
Binary file added src/assets/data/skies/intermediate/sky_bk.jpg
Binary file added src/assets/data/skies/intermediate/sky_dn.jpg
Binary file added src/assets/data/skies/intermediate/sky_fr.jpg
Binary file added src/assets/data/skies/intermediate/sky_lf.jpg
Binary file added src/assets/data/skies/intermediate/sky_rt.jpg
Binary file added src/assets/data/skies/intermediate/sky_up.jpg
Binary file added src/assets/data/skies/night oil spill/1.png
Binary file added src/assets/data/skies/night oil spill/2.png
Binary file added src/assets/data/skies/night oil spill/3.png
Binary file added src/assets/data/skies/night oil spill/4.png
Binary file added src/assets/data/skies/night oil spill/5.png
Binary file added src/assets/data/skies/night oil spill/6.png
Binary file added src/assets/data/skies/night oil spill/7.png
7 changes: 7 additions & 0 deletions src/assets/data/skies/night oil spill/sky_day.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2
3
4
1
5
6
7
Binary file added src/assets/data/skies/oldskies/enviro_map.jpg
7 changes: 7 additions & 0 deletions src/assets/data/skies/oldskies/old_sky.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky_FR
sky_RT
sky_BK
sky_LF
sky_UP
sky_DN
enviro_map
Binary file added src/assets/data/skies/oldskies/sky_bk.jpg
Binary file added src/assets/data/skies/oldskies/sky_dn.jpg
Binary file added src/assets/data/skies/oldskies/sky_fr.jpg
Binary file added src/assets/data/skies/oldskies/sky_lf.jpg
Binary file added src/assets/data/skies/oldskies/sky_rt.jpg
Binary file added src/assets/data/skies/oldskies/sky_up.jpg
Binary file added src/assets/data/skies/purple evening/1.png
Binary file added src/assets/data/skies/purple evening/2.png
Binary file added src/assets/data/skies/purple evening/3.png
Binary file added src/assets/data/skies/purple evening/4.png
Binary file added src/assets/data/skies/purple evening/5.png
Binary file added src/assets/data/skies/purple evening/6.png
Binary file added src/assets/data/skies/purple evening/7.png
7 changes: 7 additions & 0 deletions src/assets/data/skies/purple evening/purple evening.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2
3
4
1
5
6
7
Binary file added src/assets/data/skies/sands_rotated/sky_bk.jpg
7 changes: 7 additions & 0 deletions src/assets/data/skies/sands_rotated/sky_day.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky_FR
sky_RT
sky_BK
sky_LF
sky_UP
sky_DN
enviro_map
Binary file added src/assets/data/skies/sands_rotated/sky_dn.jpg
Binary file added src/assets/data/skies/sands_rotated/sky_fr.jpg
Binary file added src/assets/data/skies/sands_rotated/sky_lf.jpg
Binary file added src/assets/data/skies/sands_rotated/sky_rt.jpg
Binary file added src/assets/data/skies/sands_rotated/sky_up.jpg
Binary file added src/assets/data/skies/seasons/seasons_bk.jpg
Binary file added src/assets/data/skies/seasons/seasons_dn.jpg
Binary file added src/assets/data/skies/seasons/seasons_fr.jpg
Binary file added src/assets/data/skies/seasons/seasons_lf.jpg
Binary file added src/assets/data/skies/seasons/seasons_rt.jpg
Binary file added src/assets/data/skies/seasons/seasons_up.jpg
7 changes: 7 additions & 0 deletions src/assets/data/skies/seasons/sky_seasons.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
seasons_FR
seasons_RT
seasons_BK
seasons_LF
seasons_UP
seasons_DN
enviro_map
Binary file added src/assets/data/skies/snow/1.bmp
Binary file not shown.
Binary file added src/assets/data/skies/snow/2.bmp
Binary file not shown.
Binary file added src/assets/data/skies/snow/3.bmp
Binary file not shown.
Binary file added src/assets/data/skies/snow/4.bmp
Binary file not shown.
Binary file added src/assets/data/skies/snow/5.bmp
Binary file not shown.
Binary file added src/assets/data/skies/snow/6.bmp
Binary file not shown.
Binary file added src/assets/data/skies/snow/7.bmp
Binary file not shown.
7 changes: 7 additions & 0 deletions src/assets/data/skies/snow/snow.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1
2
3
4
5
6
7
Binary file added src/assets/data/skies/soothing orange/1.png
Binary file added src/assets/data/skies/soothing orange/2.png
Binary file added src/assets/data/skies/soothing orange/3.png
Binary file added src/assets/data/skies/soothing orange/4.png
Binary file added src/assets/data/skies/soothing orange/5.png
Binary file added src/assets/data/skies/soothing orange/6.png
Binary file added src/assets/data/skies/soothing orange/7.png
7 changes: 7 additions & 0 deletions src/assets/data/skies/soothing orange/sky_day.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2
3
4
1
5
6
7
Binary file added src/assets/data/skies/spacestation/enviro_map.jpg
Binary file added src/assets/data/skies/spacestation/sky_bk.jpg
Binary file added src/assets/data/skies/spacestation/sky_dn.jpg
Binary file added src/assets/data/skies/spacestation/sky_fr.jpg
Binary file added src/assets/data/skies/spacestation/sky_lf.jpg
Binary file added src/assets/data/skies/spacestation/sky_rt.jpg
Binary file added src/assets/data/skies/spacestation/sky_up.jpg
7 changes: 7 additions & 0 deletions src/assets/data/skies/spacestation/spacestationsky.dml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sky_FR
sky_RT
sky_BK
sky_LF
sky_UP
sky_DN
enviro_map
36 changes: 36 additions & 0 deletions src/css/level_select.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@
white-space: pre-line;
}

#level-artist {
font-family: Arial, sans-serif;
margin: 0;
margin-left: 31px;
font-size: 9px;
white-space: pre-line;
}

#level-description {
font-family: Arial, sans-serif;
margin: 0;
Expand Down Expand Up @@ -246,4 +254,32 @@
height: 25px;
bottom: 0;
right: 0;
}

#search-bar {
position: absolute;
top: -23px;
left: 0;
height: 22px;
width: 252px;
border-image: url(../assets/ui/common/window.png) stretch;
border-width: 11px;
border-style: solid;
border-image-slice: 29 fill;
box-sizing: border-box;
}

#search-input {
position: absolute;
top: -19px;
left: 16px;
font-size: 12px;
background: transparent;
border: none;
font-family: Arial, sans-serif;
width: 210px;
}

#search-input:focus {
outline: none;
}
10 changes: 10 additions & 0 deletions src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ html, body {
right: 0;
font-family: DomCasualRegular;
color: white;
}

#version {
position: absolute;
bottom: 0;
left: 0;
margin: 0;
font-family: Arial;
padding: 2px;
font-size: 10px;
}
30 changes: 28 additions & 2 deletions src/css/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
top: 0;
left: 0;
width: 100%;
height: 100%;
height: 125%;
z-index: 1;
}

Expand Down Expand Up @@ -415,7 +415,7 @@
top: 0;
left: 0;
width: 100%;
height: 100%;
height: 125%;
z-index: 1;
}

Expand Down Expand Up @@ -567,4 +567,30 @@
font-family: Arial, sans-serif;
font-size: 11px;
pointer-events: none;
}

#button-restart-level-label {
position: absolute;
top: 424px;
left: 62px;
font-family: 'DomCasualRegular';
font-size: 22px;
}

#button-restart-level {
position: absolute;
top: 418px;
left: 165px;
}

#button-restart-level-content {
margin: 0;
position: absolute;
top: 432px;
left: 120px;
text-align: center;
width: 200px;
font-family: Arial, sans-serif;
font-size: 11px;
pointer-events: none;
}
19 changes: 11 additions & 8 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@
<div style="font-family: DomCasualRegular;" id="alert-text"></div>
<img id="center-text" src=""></img>
<canvas id="clock" height="50" width="300"></canvas>
<div id="gem-count">
<img src="./assets/ui/game/numbers/0.png">
<img src="./assets/ui/game/numbers/0.png">
<img src="./assets/ui/game/numbers/slash.png">
<img src="./assets/ui/game/numbers/0.png">
<img src="./assets/ui/game/numbers/0.png">
</div>
<div id="gem-count"></div>
<div id="pause-screen" class="hidden">
<img src="./assets/ui/common/dialog.png">
<p>Exit from this Level?</p>
Expand All @@ -49,7 +43,7 @@
<img src="./assets/ui/play/playgui.png">
<div id="finish-screen-time">
<p>Final Time:</p>
<p id="finish-screen-time-time">00.00.92</p>
<p id="finish-screen-time-time"></p>
</div>
<div style="clear: both;"></div>
<p id="finish-message"></p>
Expand Down Expand Up @@ -102,6 +96,7 @@

<div id="menu" class="hidden">
<img src="./assets/ui/background.jpg" id="background-image">
<p id="version">MBGW v1.4.0</p>

<div id="home-screen">
<img src="./assets/ui/home/homegui.png">
Expand All @@ -122,6 +117,7 @@
<img src="./assets/ui/play/text_window.png" style="position: absolute; top: 0; left: 0; z-index: -1;">
<div id="level-select-text-window-scrollable">
<p id="level-title"></p>
<p id="level-artist"></p>
<p id="level-description"></p>
<p id="level-qualify-time"></p>
<p id="best-times-heading">Best Times:</p>
Expand Down Expand Up @@ -153,6 +149,8 @@
<img src="./assets/data/missions/advanced/3foldmaze.jpg" id="level-image">
<div id="not-qualified-overlay" style="display: none;">Not Qualified!</div>
<p id="level-number"></p>
<div id="search-bar"></div>
<input id="search-input" maxlength="40" placeholder="Search Levels..." autocomplete="off" autocorrect="off" spellcheck="false">
</div>
<img src="./assets/ui/play/prev_n.png" id="level-select-prev">
<img src="./assets/ui/play/play_n.png" id="level-select-play">
Expand Down Expand Up @@ -397,6 +395,10 @@
<img src="./assets/ui/options/cntrl_mous_bttn_n.png" id="free-look-key">
<p id="free-look-key-content"></p>
</div>

<div id="button-restart-level-label">Restart Key</div>
<img src="./assets/ui/options/cntr_cam_dwn_n.png" id="button-restart-level">
<p id="button-restart-level-content"></p>
</div>
</div>
</div>
Expand All @@ -409,6 +411,7 @@
<script src="./lib/three.js" defer></script>
<script src="./lib/oimo.js" defer></script>
<script src="./lib/pako.js" defer></script>
<script src="./lib/jszip.js" defer></script>
<div></div>
<script src="./js/bundle.js" defer></script>
</body>
Expand Down
15 changes: 15 additions & 0 deletions src/lib/jszip.js

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions src/php/get_custom_level.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

header('Content-Type: application/zip');

$id = $_GET["id"];
if (!isset($id)) exit();

function createPath($path) {
if (is_dir($path)) return true;
$prev_path = substr($path, 0, strrpos($path, '/', -2) + 1 );
$return = createPath($prev_path);
return ($return && is_writable($prev_path)) ? mkdir($path) : false;
}

$cwd = getcwd();
createPath($cwd . "/../storage/customs"); // Create the custom level directory if it doesn't exist yet
$filePath = $cwd . "/../storage/customs/zip" . $id . ".zip";
if (file_exists($filePath)) {
// If the zip has already been requested before, serve the cached version.
echo file_get_contents($filePath);
exit();
}

function getSslPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}

// Get the level zip from the CLA server
$result = getSslPage("https://cla.higuy.me/api/v1/missions/" . $id . "/zip?official=true");
file_put_contents($filePath, $result);

// Now we clean up the archive...
$zip = new ZipArchive();
$zip->open($filePath);
$zipFilenames = []; // Get a list of all filenames first
for ($i = 0; $i < $zip->numFiles; $i++) {
$filename = $zip->getNameIndex($i);
$zipFilenames[] = $filename;
}

for ($i = 0; $i < count($zipFilenames); $i++) {
$filename = $zipFilenames[$i];
if (strpos($filename, "interiors_mbg/") !== false) {
// Clean up interior name inconsistency
$oldFilename = $filename;
$filename = str_replace("interiors_mbg/", "interiors/", $filename);
$zip->renameName($oldFilename, $filename);
}
$path = strtolower($cwd . "/../assets/" . $filename);

// If the regular assets folder already contains this file, omit it from the zip, because we only wanna serve necessary stuff.
if (file_exists($cwd . "/../assets/" . $filename)) {
$zip->deleteName($filename);
}
}

$zip->close(); // Write it to a file

echo file_get_contents($filePath);
Loading

0 comments on commit 326bb3a

Please sign in to comment.