downgrade

This commit is contained in:
BluePotato102
2024-01-21 16:26:50 -06:00
committed by avsc-sid
parent 4e643bf2d5
commit 35e8c9cbfe
17 changed files with 14742 additions and 8462 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"content":[{"name":"game.projectc","size":4113,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":37568,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":4334256,"pieces":[{"name":"game.arcd0","offset":0},{"name":"game.arcd1","offset":2097152},{"name":"game.arcd2","offset":4194304}]},{"name":"game.dmanifest","size":40690,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]} {"content":[{"name":"game.projectc","size":3990,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":24448,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":3738056,"pieces":[{"name":"game.arcd0","offset":0},{"name":"game.arcd1","offset":2097152}]},{"name":"game.dmanifest","size":22939,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+213 -221
View File
@@ -1,221 +1,213 @@
[project] [project]
title = MonkeyMart title = MonkeyMart
version = 4.7 version = 2.1
write_log = 0 write_log = 0
compress_archive = 1 compress_archive = 1
publisher = unnamed publisher = unnamed
developer = unnamed developer = unnamed
bundle_resources = bundle bundle_resources = bundle
title_as_file_name = MonkeyMart title_as_file_name = MonkeyMart
[display] [display]
width = 960 width = 960
height = 640 height = 640
high_dpi = 1 high_dpi = 1
samples = 0 samples = 0
fullscreen = 0 fullscreen = 0
update_frequency = 60 update_frequency = 60
swap_interval = 1 swap_interval = 1
vsync = 1 vsync = 1
display_profiles = /my.display_profilesc display_profiles = /builtins/render/default.display_profilesc
dynamic_orientation = 0 dynamic_orientation = 0
display_device_info = 0 display_device_info = 0
[render] [render]
clear_color_red = 0 clear_color_red = 0
clear_color_green = 0 clear_color_green = 0
clear_color_blue = 0 clear_color_blue = 0
clear_color_alpha = 0 clear_color_alpha = 0
[physics] [physics]
type = 2D type = 2D
max_collision_object_count = 128 use_fixed_timestep = 0
use_fixed_timestep = 0 gravity_y = -10
gravity_y = -10 debug = 0
debug = 0 debug_alpha = 0.9
debug_alpha = 0.9 world_count = 4
world_count = 4 gravity_x = 0
gravity_x = 0 gravity_z = 0
gravity_z = 0 scale = 1
scale = 1 allow_dynamic_transforms = 1
allow_dynamic_transforms = 1 debug_scale = 30
debug_scale = 30 max_collisions = 64
max_collisions = 64 max_contacts = 128
max_contacts = 128 contact_impulse_limit = 0
contact_impulse_limit = 0 ray_cast_limit_2d = 64
ray_cast_limit_2d = 64 ray_cast_limit_3d = 128
ray_cast_limit_3d = 128 trigger_overlap_capacity = 16
trigger_overlap_capacity = 16 velocity_threshold = 1
velocity_threshold = 1 max_fixed_timesteps = 2
max_fixed_timesteps = 2
[bootstrap]
[bootstrap] main_collection = /main/controller.collectionc
main_collection = /main/controller.collectionc render = /orthographic/render/orthographic.renderc
render = /orthographic/render/orthographic.renderc
[graphics]
[graphics] default_texture_min_filter = linear
default_texture_min_filter = linear default_texture_mag_filter = linear
default_texture_mag_filter = linear max_draw_calls = 1024
max_draw_calls = 1024 max_characters = 8192
max_characters = 8192 max_debug_vertices = 10000
max_debug_vertices = 10000 texture_profiles = /updated.texture_profiles
texture_profiles = /updated.texture_profiles verify_graphics_calls = 1
verify_graphics_calls = 1 memory_size = 512
memory_size = 512
[shader]
[shader] output_spirv = 0
output_spirv = 0
[sound]
[sound] gain = 1
gain = 1 max_sound_data = 128
max_sound_data = 128 max_sound_buffers = 32
max_sound_buffers = 32 max_sound_sources = 16
max_sound_sources = 16 max_sound_instances = 256
max_sound_instances = 256 max_component_count = 32
max_component_count = 32 use_thread = 1
use_thread = 1
[resource]
[resource] http_cache = 0
http_cache = 0 max_resources = 1024
max_resources = 1024
[input]
[input] repeat_delay = 0.5
repeat_delay = 0.5 repeat_interval = 0.2
repeat_interval = 0.2 gamepads = /builtins/input/default.gamepadsc
gamepads = /builtins/input/default.gamepadsc game_binding = /input/game.input_bindingc
game_binding = /input/game.input_bindingc use_accelerometer = 1
use_accelerometer = 1
[sprite]
[sprite] max_count = 1024
max_count = 512 subpixels = 1
subpixels = 1
[model]
[model] max_count = 128
max_count = 128 split_meshes = 0
split_meshes = 0
[mesh]
[mesh] max_count = 128
max_count = 128
[gui]
[gui] max_count = 64
max_count = 64 max_particlefx_count = 64
max_particlefx_count = 64 max_particle_count = 1024
max_particle_count = 1024
max_animation_count = 1024 [collection]
max_instances = 2048
[collection] max_input_stack_entries = 16
max_instances = 2048
max_input_stack_entries = 16 [collection_proxy]
max_count = 8
[collection_proxy]
max_count = 10 [collectionfactory]
max_count = 128
[collectionfactory]
max_count = 128 [factory]
max_count = 128
[factory]
max_count = 128 [ios]
launch_screen = /builtins/manifests/ios/LaunchScreen.storyboardc
[ios] pre_renderered_icons = 0
launch_screen = /builtins/manifests/ios/LaunchScreen.storyboardc bundle_identifier = example.unnamed
pre_renderered_icons = 0 bundle_name =
bundle_identifier = example.unnamed infoplist = /builtins/manifests/ios/Info.plist
bundle_name = default_language = en
infoplist = /builtins/manifests/ios/Info.plist localizations = en
default_language = en
localizations = en [android]
version_code = 1
[android] minimum_sdk_version = 16
version_code = 1 target_sdk_version = 31
minimum_sdk_version = 19 package = com.example.todo
target_sdk_version = 33 gcm_sender_id =
package = com.tinydobbins.testmonkey manifest = /builtins/manifests/android/AndroidManifest.xml
gcm_sender_id = iap_provider = GooglePlay
manifest = /builtins/manifests/android/AndroidManifest.xml input_method = HiddenInputField
iap_provider = GooglePlay immersive_mode = 0
input_method = HiddenInputField display_cutout = 1
immersive_mode = 0 debuggable = 0
display_cutout = 1 proguard =
debuggable = 0
proguard = [osx]
app_icon =
[osx] infoplist = /builtins/manifests/osx/Info.plist
app_icon = bundle_identifier = example.unnamed
infoplist = /builtins/manifests/osx/Info.plist bundle_name =
bundle_identifier = example.unnamed bundle_version = 1
bundle_name = default_language = en
bundle_version = 1 localizations = en
default_language = en
localizations = en [windows]
app_icon =
[windows]
app_icon = [html5]
custom_heap_size = 0
[html5] heap_size = 64
custom_heap_size = 0 htmlfile = /engine_template.html
heap_size = 128 cssfile = /css_theme.css
htmlfile = /engine_template.html splash_image = /images/bg_loading.png
cssfile = /css_theme.css archive_location_prefix = archive
splash_image = /images/bg_loading.png archive_location_suffix =
archive_location_prefix = archive engine_arguments = --verify-graphics-calls=false
archive_location_suffix = wasm_streaming = 0
engine_arguments = --verify-graphics-calls=false show_fullscreen_button = 0
wasm_streaming = 0 show_made_with_defold = 0
show_fullscreen_button = 0 show_console_banner = 1
show_made_with_defold = 0 scale_mode = stretch
show_console_banner = 1
scale_mode = stretch [particle_fx]
max_count = 0
[particle_fx] max_emitter_count = 0
max_count = 0 max_particle_count = 0
max_emitter_count = 0
max_particle_count = 0 [iap]
auto_finish_transactions = 1
[iap]
auto_finish_transactions = 1 [network]
http_timeout = 0
[network] ssl_certificates =
http_timeout = 0 http_thread_count = 4
ssl_certificates = http_cache_enabled = 1
http_thread_count = 4
http_cache_enabled = 1 [library]
include_dirs =
[library]
include_dirs = [script]
shared_state = 1
[script]
shared_state = 1 [label]
max_count = 64
[label] subpixels = 1
max_count = 128
subpixels = 1 [profiler]
track_cpu = 0
[profiler] sleep_between_server_updates = 0
track_cpu = 0
sleep_between_server_updates = 0 [liveupdate]
settings = /liveupdate.settings
[liveupdate] enabled = 1
settings = /liveupdate.settings
enabled = 1 [tilemap]
max_count = 0
[tilemap] max_tile_count = 0
max_count = 0
max_tile_count = 0 [engine]
run_while_iconified = 0
[engine] fixed_update_frequency = 60
run_while_iconified = 0
fixed_update_frequency = 60 [native_extension]
app_manifest = /manifest.appmanifest
[gameanalytics]
game_key_html5 = 8460790931685c9f59f3e669a97521bd [gameanalytics]
secret_key_html5 = 6d3a08c1c25fca8bb1587ed50c42a81ddff80aa0 game_key_html5 = 8460790931685c9f59f3e669a97521bd
secret_key_html5 = 6d3a08c1c25fca8bb1587ed50c42a81ddff80aa0
[spine]
max_count = 512
[native_extension]
app_manifest = /manifest.appmanifest
[liveupdate_reszip]
wipe_on_start = 1
Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 152 KiB

+122 -113
View File
@@ -109,8 +109,12 @@ var EngineLoader = {
loadAndInstantiateWasmAsync: function(src, fromProgress, toProgress, callback) { loadAndInstantiateWasmAsync: function(src, fromProgress, toProgress, callback) {
FileLoader.load(src, "arraybuffer", EngineLoader.wasm_size, FileLoader.load(src, "arraybuffer", EngineLoader.wasm_size,
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); }, function(loaded, total) {
function(error) { throw error; }, Progress.calculateProgress(fromProgress, toProgress, loaded, total);
},
function(error) {
throw error;
},
function(wasm) { function(wasm) {
Module.instantiateWasm = function(imports, successCallback) { Module.instantiateWasm = function(imports, successCallback) {
var wasmInstantiate = WebAssembly.instantiate(new Uint8Array(wasm), imports).then(function(output) { var wasmInstantiate = WebAssembly.instantiate(new Uint8Array(wasm), imports).then(function(output) {
@@ -132,15 +136,12 @@ var EngineLoader = {
async function fetchWithProgress(path) { async function fetchWithProgress(path) {
const response = await fetch(path); const response = await fetch(path);
// May be incorrect if compressed // May be incorrect if compressed
var contentLength = response.headers.get("Content-Length"); const contentLength = response.headers.get("Content-Length");
if (!contentLength){
contentLength = EngineLoader.wasm_size;
}
const total = parseInt(contentLength, 10); const total = parseInt(contentLength, 10);
let bytesLoaded = 0; let bytesLoaded = 0;
const ts = new TransformStream({ const ts = new TransformStream({
transform (chunk, controller) { transform(chunk, controller) {
bytesLoaded += chunk.byteLength; bytesLoaded += chunk.byteLength;
Progress.calculateProgress(fromProgress, toProgress, bytesLoaded, total); Progress.calculateProgress(fromProgress, toProgress, bytesLoaded, total);
controller.enqueue(chunk) controller.enqueue(chunk)
@@ -170,8 +171,7 @@ var EngineLoader = {
if (EngineLoader.stream_wasm && (typeof WebAssembly.instantiateStreaming === "function")) { if (EngineLoader.stream_wasm && (typeof WebAssembly.instantiateStreaming === "function")) {
EngineLoader.setupWasmStreamAsync(exeName + ".wasm", 10, 50); EngineLoader.setupWasmStreamAsync(exeName + ".wasm", 10, 50);
EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 0, 10); EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 0, 10);
} } else {
else {
EngineLoader.loadAndInstantiateWasmAsync(exeName + ".wasm", 0, 40, function() { EngineLoader.loadAndInstantiateWasmAsync(exeName + ".wasm", 0, 40, function() {
EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 40, 50); EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 40, 50);
}); });
@@ -185,12 +185,16 @@ var EngineLoader = {
// load and start engine script (asm.js or wasm.js) // load and start engine script (asm.js or wasm.js)
loadAndRunScriptAsync: function(src, estimatedSize, fromProgress, toProgress) { loadAndRunScriptAsync: function(src, estimatedSize, fromProgress, toProgress) {
FileLoader.load(src, "text", estimatedSize, FileLoader.load(src, "text", estimatedSize,
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); }, function(loaded, total) {
function(error) { throw error; }, Progress.calculateProgress(fromProgress, toProgress, loaded, total);
},
function(error) {
throw error;
},
function(response) { function(response) {
var tag = document.createElement("script"); var tag = document.createElement("script");
tag.text = response; tag.text = response;
document.body.appendChild(tag); document.head.appendChild(tag);
}); });
}, },
@@ -226,19 +230,21 @@ var GameArchiveLoader = {
//MAX_CONCURRENT_XHR: 6, // remove comment if throttling of XHR is desired. //MAX_CONCURRENT_XHR: 6, // remove comment if throttling of XHR is desired.
isCompleted: false, // status of process isCompleted: false, // status of process
_onFileLoadedListeners: [], // signature: name, data. _onFileLoadedListeners: [], // signature: name, data.
_onArchiveLoadedListeners:[], // signature: void _onArchiveLoadedListeners: [], // signature: void
_onFileDownloadErrorListeners: [], // signature: name _onFileDownloadErrorListeners: [], // signature: name
_currentDownloadBytes: 0, _currentDownloadBytes: 0,
_totalDownloadBytes: 0, _totalDownloadBytes: 0,
_archiveLocationFilter: function(path) { return "split" + path; }, _archiveLocationFilter: function(path) {
return "split" + path;
},
cleanUp: function() { cleanUp: function() {
this._files = []; this._files = [];
this._fileIndex = 0; this._fileIndex = 0;
this.isCompleted = false; this.isCompleted = false;
this._onGameArchiveLoaderCompletedListeners = []; this._onGameArchiveLoaderCompletedListeners = [];
@@ -254,7 +260,7 @@ var GameArchiveLoader = {
list.push(callback); list.push(callback);
}, },
notifyListeners: function(list, data) { notifyListeners: function(list, data) {
for (i=0; i<list.length; ++i) { for (i = 0; i < list.length; ++i) {
list[i](data); list[i](data);
} }
}, },
@@ -270,7 +276,10 @@ var GameArchiveLoader = {
this.addListener(this._onFileLoadedListeners, callback); this.addListener(this._onFileLoadedListeners, callback);
}, },
notifyFileLoaded: function(file) { notifyFileLoaded: function(file) {
this.notifyListeners(this._onFileLoadedListeners, { name: file.name, data: file.data }); this.notifyListeners(this._onFileLoadedListeners, {
name: file.name,
data: file.data
});
}, },
addArchiveLoadedListener: function(callback) { addArchiveLoadedListener: function(callback) {
@@ -293,9 +302,13 @@ var GameArchiveLoader = {
this._archiveLocationFilter(descriptionUrl), this._archiveLocationFilter(descriptionUrl),
"json", "json",
undefined, undefined,
function (loaded, total) { }, function(loaded, total) {},
function (error) { GameArchiveLoader.notifyFileDownloadError(descriptionUrl); }, function(error) {
function (json) { GameArchiveLoader.onReceiveDescription(json); }); GameArchiveLoader.notifyFileDownloadError(descriptionUrl);
},
function(json) {
GameArchiveLoader.onReceiveDescription(json);
});
}, },
onReceiveDescription: function(json) { onReceiveDescription: function(json) {
@@ -304,7 +317,7 @@ var GameArchiveLoader = {
this._currentDownloadBytes = 0; this._currentDownloadBytes = 0;
// calculate total download size of all files // calculate total download size of all files
for(var i=0; i<this._files.length; ++i) { for (var i = 0; i < this._files.length; ++i) {
this._totalDownloadBytes += this._files[i].size; this._totalDownloadBytes += this._files[i].size;
} }
this.downloadContent(); this.downloadContent();
@@ -322,7 +335,7 @@ var GameArchiveLoader = {
limit = Math.min(limit, this.MAX_CONCURRENT_XHR); limit = Math.min(limit, this.MAX_CONCURRENT_XHR);
} }
// download pieces // download pieces
for (var i=0; i<limit; ++i) { for (var i = 0; i < limit; ++i) {
this.downloadPiece(file, i); this.downloadPiece(file, i);
} }
}, },
@@ -346,16 +359,16 @@ var GameArchiveLoader = {
FileLoader.load( FileLoader.load(
url, "arraybuffer", undefined, url, "arraybuffer", undefined,
function (loaded, total) { function(loaded, total) {
var delta = loaded - downloaded; var delta = loaded - downloaded;
downloaded = loaded; downloaded = loaded;
GameArchiveLoader._currentDownloadBytes += delta; GameArchiveLoader._currentDownloadBytes += delta;
GameArchiveLoader.notifyDownloadProgress(); GameArchiveLoader.notifyDownloadProgress();
}, },
function (error) { function(error) {
GameArchiveLoader.notifyFileDownloadError(error); GameArchiveLoader.notifyFileDownloadError(error);
}, },
function (response) { function(response) {
piece.data = new Uint8Array(response); piece.data = new Uint8Array(response);
piece.dataLength = piece.data.length; piece.dataLength = piece.data.length;
total = piece.dataLength; total = piece.dataLength;
@@ -403,18 +416,18 @@ var GameArchiveLoader = {
verifyFile: function(file) { verifyFile: function(file) {
// verify that we downloaded as much as we were supposed to // verify that we downloaded as much as we were supposed to
var actualSize = 0; var actualSize = 0;
for (var i=0;i<file.pieces.length; ++i) { for (var i = 0; i < file.pieces.length; ++i) {
actualSize += file.pieces[i].dataLength; actualSize += file.pieces[i].dataLength;
} }
if (actualSize != file.size) { // if (actualSize != file.size) {
throw "Unexpected data size"; // throw "Unexpected data size";
} // }
// verify the pieces // verify the pieces
if (file.pieces.length > 1) { if (file.pieces.length > 1) {
var output = file.data; var output = file.data;
var pieces = file.pieces; var pieces = file.pieces;
for (i=0; i<pieces.length; ++i) { for (i = 0; i < pieces.length; ++i) {
var item = pieces[i]; var item = pieces[i];
// Bounds check // Bounds check
var start = item.offset; var start = item.offset;
@@ -468,12 +481,12 @@ var Progress = {
}, },
notifyListeners: function(percentage) { notifyListeners: function(percentage) {
for (i=0; i<this.listeners.length; ++i) { for (i = 0; i < this.listeners.length; ++i) {
this.listeners[i](percentage); this.listeners[i](percentage);
} }
}, },
addProgress : function (canvas) { addProgress: function(canvas) {
/* Insert default progress bar below canvas */ /* Insert default progress bar below canvas */
canvas.insertAdjacentHTML('afterend', '<div id="' + Progress.progress_id + '" class="canvas-app-progress"><div id="' + Progress.bar_id + '" class="canvas-app-progress-bar" style="width: 0%;"></div></div>'); canvas.insertAdjacentHTML('afterend', '<div id="' + Progress.progress_id + '" class="canvas-app-progress"><div id="' + Progress.bar_id + '" class="canvas-app-progress-bar" style="width: 0%;"></div></div>');
Progress.bar = document.getElementById(Progress.bar_id); Progress.bar = document.getElementById(Progress.bar_id);
@@ -482,16 +495,16 @@ var Progress = {
updateProgress: function(percentage) { updateProgress: function(percentage) {
if (Progress.bar) { if (Progress.bar) {
Progress.bar.style.width = Math.min(percentage, 100) + "%"; Progress.bar.style.width = percentage + "%";
} }
Progress.notifyListeners(percentage); Progress.notifyListeners(percentage);
}, },
calculateProgress: function (from, to, current, total) { calculateProgress: function(from, to, current, total) {
this.updateProgress(from + (current / total) * (to - from)); this.updateProgress(from + (current / total) * (to - from));
}, },
removeProgress: function () { removeProgress: function() {
if (Progress.progress.parentElement !== null) { if (Progress.progress.parentElement !== null) {
Progress.progress.parentElement.removeChild(Progress.progress); Progress.progress.parentElement.removeChild(Progress.progress);
@@ -524,10 +537,16 @@ var Module = {
arguments: [], arguments: [],
print: function(text) { console.log(text); }, print: function(text) {
printErr: function(text) { console.error(text); }, console.log(text);
},
printErr: function(text) {
console.error(text);
},
setStatus: function(text) { console.log(text); }, setStatus: function(text) {
console.log(text);
},
isWASMSupported: (function() { isWASMSupported: (function() {
try { try {
@@ -536,18 +555,17 @@ var Module = {
if (module instanceof WebAssembly.Module) if (module instanceof WebAssembly.Module)
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance; return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
} }
} catch (e) { } catch (e) {}
}
return false; return false;
})(), })(),
prepareErrorObject: function (err, url, line, column, errObj) { prepareErrorObject: function(err, url, line, column, errObj) {
line = typeof line == "undefined" ? 0 : line; line = typeof line == "undefined" ? 0 : line;
column = typeof column == "undefined" ? 0 : column; column = typeof column == "undefined" ? 0 : column;
url = typeof url == "undefined" ? "" : url; url = typeof url == "undefined" ? "" : url;
var errorLine = url + ":" + line + ":" + column; var errorLine = url + ":" + line + ":" + column;
var error = errObj || (typeof window.event != "undefined" ? window.event.error : "" ) || err || "Undefined Error"; var error = errObj || (typeof window.event != "undefined" ? window.event.error : "") || err || "Undefined Error";
var message = ""; var message = "";
var stack = ""; var stack = "";
var backtrace = ""; var backtrace = "";
@@ -575,7 +593,10 @@ var Module = {
stack = stack.replace(/^((?:Object|Array)\.)/gm, ""); stack = stack.replace(/^((?:Object|Array)\.)/gm, "");
stack = stack.split("\n"); stack = stack.split("\n");
return { stack:stack, message:message }; return {
stack: stack,
message: message
};
}, },
hasWebGLSupport: function() { hasWebGLSupport: function() {
@@ -602,42 +623,44 @@ var Module = {
/** /**
* Module.runApp - Starts the application given a canvas element id * Module.runApp - Starts the application given a canvas element id
* *
* 'extra_params' is an optional object that can have the following fields: * 'extra_params' is an optional object that can have the following fields:
* *
* 'archive_location_filter': * 'archive_location_filter':
* Filter function that will run for each archive path. * Filter function that will run for each archive path.
* *
* 'unsupported_webgl_callback': * 'unsupported_webgl_callback':
* Function that is called if WebGL is not supported. * Function that is called if WebGL is not supported.
* *
* 'engine_arguments': * 'engine_arguments':
* List of arguments (strings) that will be passed to the engine. * List of arguments (strings) that will be passed to the engine.
* *
* 'persistent_storage': * 'persistent_storage':
* Boolean toggling the usage of persistent storage. * Boolean toggling the usage of persistent storage.
* *
* 'custom_heap_size': * 'custom_heap_size':
* Number of bytes specifying the memory heap size. * Number of bytes specifying the memory heap size.
* *
* 'disable_context_menu': * 'disable_context_menu':
* Disables the right-click context menu on the canvas element if true. * Disables the right-click context menu on the canvas element if true.
* *
* 'retry_time': * 'retry_time':
* Pause before retry file loading after error. * Pause before retry file loading after error.
* *
* 'retry_count': * 'retry_count':
* How many attempts we do when trying to download a file. * How many attempts we do when trying to download a file.
* *
* 'can_not_download_file_callback': * 'can_not_download_file_callback':
* Function that is called if you can't download file after 'retry_count' attempts. * Function that is called if you can't download file after 'retry_count' attempts.
**/ **/
runApp: function(appCanvasId, extra_params) { runApp: function(appCanvasId, extra_params) {
Module.setupCanvas(appCanvasId); Module.setupCanvas(appCanvasId);
var params = { var params = {
archive_location_filter: function(path) { return 'split' + path; }, archive_location_filter: function(path) {
return 'split' + path;
},
unsupported_webgl_callback: undefined, unsupported_webgl_callback: undefined,
engine_arguments: [], engine_arguments: [],
persistent_storage: true, persistent_storage: true,
@@ -667,8 +690,7 @@ var Module = {
Module.canvas.focus(); Module.canvas.focus();
// Add context menu hide-handler if requested // Add context menu hide-handler if requested
if (params["disable_context_menu"]) if (params["disable_context_menu"]) {
{
Module.canvas.oncontextmenu = function(e) { Module.canvas.oncontextmenu = function(e) {
e.preventDefault(); e.preventDefault();
}; };
@@ -697,7 +719,10 @@ var Module = {
}, },
onArchiveFileLoaded: function(file) { onArchiveFileLoaded: function(file) {
Module._filesToPreload.push({path: file.name, data: file.data}); Module._filesToPreload.push({
path: file.name,
data: file.data
});
}, },
onArchiveLoaded: function() { onArchiveLoaded: function() {
@@ -719,16 +744,11 @@ var Module = {
}, },
preSync: function(done) { preSync: function(done) {
if (Module.persistentStorage != true) {
Module._syncInitial = true;
done();
return;
}
// Initial persistent sync before main is called // Initial persistent sync before main is called
FS.syncfs(true, function(err) { FS.syncfs(true, function(err) {
if (err) { if (err) {
Module._syncTries += 1; Module._syncTries += 1;
console.warn("Unable to synchronize mounted file systems: " + err); console.error("FS syncfs error: " + err);
if (Module._syncMaxTries > Module._syncTries) { if (Module._syncMaxTries > Module._syncTries) {
Module.preSync(done); Module.preSync(done);
} else { } else {
@@ -759,9 +779,6 @@ var Module = {
// It will flag that another one is needed if there is already one sync running. // It will flag that another one is needed if there is already one sync running.
persistentSync: function() { persistentSync: function() {
if (Module.persistentStorage != true) {
return;
}
// Need to wait for the initial sync to finish since it // Need to wait for the initial sync to finish since it
// will call close on all its file streams which will trigger // will call close on all its file streams which will trigger
// new persistentSync for each. // new persistentSync for each.
@@ -775,22 +792,17 @@ var Module = {
}, },
preInit: [function() { preInit: [function() {
// Mount filesystem on preinit /* Mount filesystem on preinit */
var dir = DMSYS.GetUserPersistentDataRoot(); var dir = DMSYS.GetUserPersistentDataRoot();
try { FS.mkdir(dir);
FS.mkdir(dir);
}
catch (error) {
Module.persistentStorage = false;
Module._preloadAndCallMain();
return;
}
// If IndexedDB is supported we mount the persistent data root as IDBFS, // If IndexedDB is supported we mount the persistent data root as IDBFS,
// then try to do a IDB->MEM sync before we start the engine to get // then try to do a IDB->MEM sync before we start the engine to get
// previously saved data before boot. // previously saved data before boot.
try { window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
if (Module.persistentStorage && window.indexedDB) {
FS.mount(IDBFS, {}, dir); FS.mount(IDBFS, {}, dir);
// Patch FS.close so it will try to sync MEM->IDB // Patch FS.close so it will try to sync MEM->IDB
var _close = FS.close; var _close = FS.close;
FS.close = function(stream) { FS.close = function(stream) {
@@ -798,28 +810,25 @@ var Module = {
Module.persistentSync(); Module.persistentSync();
return r; return r;
} }
}
catch (error) {
Module.persistentStorage = false;
Module._preloadAndCallMain();
return;
}
// Sync IDB->MEM before calling main() // Sync IDB->MEM before calling main()
Module.preSync(function() { Module.preSync(function() {
Module._preloadAndCallMain();
});
} else {
Module._preloadAndCallMain(); Module._preloadAndCallMain();
}); }
}], }],
preRun: [function() { preRun: [function() {
/* If archive is loaded, preload all its files */ /* If archive is loaded, preload all its files */
if(Module._archiveLoaded) { if (Module._archiveLoaded) {
Module.preloadAll(); Module.preloadAll();
} }
}], }],
postRun: [function() { postRun: [function() {
if(Module._archiveLoaded) { if (Module._archiveLoaded) {
Progress.removeProgress(); Progress.removeProgress();
} }
}], }],
@@ -850,7 +859,7 @@ var Module = {
Module._syncInProgress = false; Module._syncInProgress = false;
if (err) { if (err) {
console.warn("Unable to synchronize mounted file systems: " + err); console.error("Module._startSyncFS error: " + err);
Module._syncTries += 1; Module._syncTries += 1;
} }
@@ -873,4 +882,4 @@ window.onerror = function(err, url, line, column, errObj) {
Module.setStatus = function(text) { Module.setStatus = function(text) {
if (text) Module.printErr('[post-exception status] ' + text); if (text) Module.printErr('[post-exception status] ' + text);
}; };
}; };
+386 -363
View File
@@ -1,363 +1,386 @@
<!doctype html> <!DOCTYPE html>
<html lang="en">
<head> <html lang="en">
<meta charset="utf-8"> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, shrink-to-fit=no"> <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
<meta name="apple-mobile-web-app-capable" content="yes"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, shrink-to-fit=no" name="viewport"/>
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta content="yes" name="apple-mobile-web-app-capable"/>
<title>Monkey Mart</title> <!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<style type="text/css"> <title>Monkey Mart</title>
/* Disable user selection to avoid strange bug in Chrome on Windows: <meta content="Monkey Mart is a fun game that you can play at school from chromebook. In our catalog you can find many cool online games that you may enjoy." name="description"/>
* Selecting a text outside the canvas, then clicking+draging would <script src="Jump_Game.js" type="text/javascript"></script>
* drag the selected text but block mouse down/up events to the engine. <style type="text/css">
*/ /* Disable user selection to avoid strange bug in Chrome on Windows:
body { * Selecting a text outside the canvas, then clicking+draging would
* drag the selected text but block mouse down/up events to the engine.
position: fixed; /* Prevent overscroll */ */
body {
margin:0; position: fixed;
padding:0; /* Prevent overscroll */
} margin: 0;
padding: 0;
.canvas-app-container { }
width: 100%;
height: 100%; .canvas-app-container {
position: absolute; width: 100%;
align-items: center; height: 100%;
justify-content: center; position: absolute;
overflow: hidden; align-items: center;
} justify-content: center;
overflow: hidden;
.canvas-app-container:-webkit-full-screen { }
/* Auto width and height in Safari/Chrome fullscreen. */
width: auto; .canvas-app-container:-webkit-full-screen {
height: auto; /* Auto width and height in Safari/Chrome fullscreen. */
} width: auto;
height: auto;
#canvas { }
outline: none;
border: 0; #canvas {
width: 100%; outline: none;
vertical-align: bottom; border: 0;
} width: 100%;
vertical-align: bottom;
#canvas-container { }
position: relative;
} #canvas-container {
position: relative;
canvas:focus, canvas:active { }
outline: none;
border: 0; canvas:focus, canvas:active {
ie-dummy: expression(this.hideFocus=true); outline: none;
-moz-outline-style: none; border: 0;
} ie-dummy: expression(this.hideFocus=true);
-moz-outline-style: none;
div { }
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none; div {
-webkit-user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-khtml-user-select: none; -webkit-touch-callout: none;
-moz-user-select: none; -webkit-user-select: none;
-ms-user-select: none; -khtml-user-select: none;
user-select: none; -moz-user-select: none;
} -ms-user-select: none;
user-select: none;
.banner-styleBottom { }
margin: 0 auto;
position: fixed; .banner-styleBottom {
bottom: 0; margin: 0 auto;
display: block; position: fixed;
left: 50%; bottom: 0;
transform: translateX(-50%); display: block;
} left: 50%;
transform: translateX(-50%);
.banner-styleTop { }
margin: 0 auto;
position: fixed; .banner-styleTop {
top: 0; margin: 0 auto;
display: block; position: fixed;
left: 50%; top: 0;
transform: translateX(-50%); display: block;
} left: 50%;
transform: translateX(-50%);
.canvas-app-progress { }
position: absolute;
background-color: #0A8A40; .canvas-app-progress {
height: 30px; position: absolute;
margin-top: -30px; background-color: #0A8A40;
width: 100%; height: 30px;
} margin-top: -30px;
width: 100%;
.canvas-app-progress-bar { }
font-size: 12px;
height: 30px; .canvas-app-progress-bar {
color: rgb(255, 255, 255); font-size: 12px;
background-color: #FFE333; height: 30px;
text-align: center; color: rgb(255, 255, 255);
line-height: 20px; background-color: #FFE333;
} text-align: center;
line-height: 20px;
}
.link, .button {
font-family: sans-serif; .link, .button {
font-size: 14px; font-family: sans-serif;
font-weight: normal; font-size: 14px;
font-style: normal; font-weight: normal;
font-stretch: normal; font-style: normal;
line-height: normal; font-stretch: normal;
letter-spacing: 0px; line-height: normal;
padding-top: 12px; letter-spacing: 0px;
} padding-top: 12px;
}
.buttons-background {
background-color: #ffffff; .buttons-background {
width: 100%; background-color: #ffffff;
height: 42px; width: 100%;
} height: 42px;
}
body {
background-color: #ffffff; body {
} background-color: #ffffff;
}
.canvas-app-container {
background: #00BB61; .canvas-app-container {
/* background: -moz-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%); background: #00BB61;
background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(250,252,255,1)), color-stop(50%, rgba(250,252,255,1)), color-stop(50%, rgba(245,249,255,1)), color-stop(100%, rgba(245,249,255,1))); /* background: -moz-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
background: -webkit-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%); background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(250,252,255,1)), color-stop(50%, rgba(250,252,255,1)), color-stop(50%, rgba(245,249,255,1)), color-stop(100%, rgba(245,249,255,1)));
background: -o-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%); background: -webkit-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
background: -ms-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%); background: -o-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
background: linear-gradient(135deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%); background: -ms-linear-gradient(-45deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafcff', endColorstr='#f5f9ff', GradientType=1 ); */ background: linear-gradient(135deg, rgba(250,252,255,1) 0%, rgba(250,252,255,1) 50%, rgba(245,249,255,1) 50%, rgba(245,249,255,1) 100%);
} filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafcff', endColorstr='#f5f9ff', GradientType=1 ); */
}
.canvas-app-canvas {
background-repeat: no-repeat; .canvas-app-canvas {
background-position: center; background-repeat: no-repeat;
background-position: center;
background-position: top; background-position: top;
background-size: cover; background-size: cover;
background-image: url("bg_loading.png"); background-image: url("bg_loading.png");
}
</style>
}
</head>
</style> <body>
<script src="js/poki-sdk.js"></script> <div class="canvas-app-container" id="app-container">
</head> <div class="canvas-app-canvas-container" id="canvas-container">
<body> <canvas class="canvas-app-canvas" height="640" id="canvas" tabindex="1" width="960"></canvas>
<div id="app-container" class="canvas-app-container"> </div>
<div id="canvas-container" class="canvas-app-canvas-container"> <div class="buttons-background"></div>
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="960" height="640"></canvas> <!-- center and anchor to bottom of page -->
</div> <div id="progress-bar-root" style="position: absolute; bottom: 16%; left: 50%; visibility: hidden; z-index: 4;">
<div class="buttons-background"> <!-- <div id="progress-bar-text"> -->
</div> <img id="progress-bar-bg" src="load_bar_bg.png"/>
<!-- center and anchor to bottom of page --> <img id="progress-bar-fg" src="load_bar_fg.png" style="position:absolute; clip: rect(0px,0px,0px,0px);"/>
<div id="progress-bar-root" style="position: absolute; bottom: 16%; left: 50%; visibility: hidden; z-index: 4;"> </div>
<!-- <div id="progress-bar-text"> --> </div>
<img id="progress-bar-bg" src="load_bar_bg.png"> <!-- -->
<img id="progress-bar-fg" src="load_bar_fg.png" style="position:absolute; clip: rect(0px,0px,0px,0px);"> <!-- <div id="bannerTop" class="banner-styleTop"></div> -->
</div> <!-- <div id="bannerBottom" class="banner-styleBottom"></div> -->
</div> <!-- -->
<!-- --> <script id="engine-loader" src="dmloader.js" type="text/javascript"></script>
<!-- <div id="bannerTop" class="banner-styleTop"></div> --> <!-- -->
<!-- <div id="bannerBottom" class="banner-styleBottom"></div> --> <script id="engine-setup" type="text/javascript">
<!-- --> var extra_params = {
<script id="engine-loader" type="text/javascript" src="dmloader.js"></script> archive_location_filter: function(path) {
<!-- --> return ("archive" + path + "");
<script id="engine-setup" type="text/javascript"> },
var extra_params = { engine_arguments: ["--verify-graphics-calls=false", ],
archive_location_filter: function( path ) { custom_heap_size: 67108864,
return ("archive" + path + ""); full_screen_container: "#canvas-container",
}, disable_context_menu: true
engine_arguments: ["--verify-graphics-calls=false",], }
custom_heap_size: 134217728,
full_screen_container: "#canvas-container", Module['INITIAL_MEMORY'] = extra_params.custom_heap_size;
disable_context_menu: true
} Module['onRuntimeInitialized'] = function() {
Module.runApp("canvas", extra_params);
Module['INITIAL_MEMORY'] = extra_params.custom_heap_size; }
;
Module['onRuntimeInitialized'] = function() {
Module.runApp("canvas", extra_params); Module["locateFile"] = function(path, scriptDirectory) {
}; // dmengine*.wasm is hardcoded in the built JS loader for WASM,
// we need to replace it here with the correct project name.
Module["locateFile"] = function(path, scriptDirectory) if (path == "dmengine.wasm" || path == "dmengine_release.wasm" || path == "dmengine_headless.wasm") {
{ path = "MonkeyMart.wasm";
// dmengine*.wasm is hardcoded in the built JS loader for WASM, }
// we need to replace it here with the correct project name. return scriptDirectory + path;
if (path == "dmengine.wasm" || path == "dmengine_release.wasm" || path == "dmengine_headless.wasm") { }
path = "MonkeyMart.wasm"; ;
}
return scriptDirectory + path; var is_iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
}; var buttonHeight = 0;
var prevInnerWidth = -1;
var is_iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; var prevInnerHeight = -1;
var buttonHeight = 0;
var prevInnerWidth = -1; function resize_game_canvas() {
var prevInnerHeight = -1; // Hack for iOS when exit from Fullscreen mode
if (is_iOS) {
window.scrollTo(0, 0);
function resize_game_canvas() { }
// Hack for iOS when exit from Fullscreen mode
if (is_iOS) { var app_container = document.getElementById('app-container');
window.scrollTo(0, 0); var game_canvas = document.getElementById('canvas');
} var progress_bar_root = document.getElementById('progress-bar-root');
var progress_bar_fg = document.getElementById('progress-bar-fg');
var app_container = document.getElementById('app-container'); var progress_bar_bg = document.getElementById('progress-bar-bg');
var game_canvas = document.getElementById('canvas'); var innerWidth = window.innerWidth;
var progress_bar_root = document.getElementById('progress-bar-root'); var innerHeight = window.innerHeight - buttonHeight;
var progress_bar_fg = document.getElementById('progress-bar-fg'); if (prevInnerWidth == innerWidth && prevInnerHeight == innerHeight) {
var progress_bar_bg = document.getElementById('progress-bar-bg'); return;
var innerWidth = window.innerWidth; }
var innerHeight = window.innerHeight - buttonHeight; prevInnerWidth = innerWidth;
if (prevInnerWidth == innerWidth && prevInnerHeight == innerHeight) prevInnerHeight = innerHeight;
{ var width = 960;
return; var height = 640;
} var targetRatio = width / height;
prevInnerWidth = innerWidth; var actualRatio = innerWidth / innerHeight;
prevInnerHeight = innerHeight;
var width = 960; //Stretch
var height = 640; width = innerWidth;
var targetRatio = width / height; height = innerHeight;
var actualRatio = innerWidth / innerHeight;
app_container.style.width = width + "px";
app_container.style.height = height + buttonHeight + "px";
//Stretch game_canvas.width = width;
width = innerWidth; game_canvas.height = height;
height = innerHeight;
// progress bar
var bar_h = width < height ? width : height;
progress_bar_bg.width = Math.min(Math.ceil(bar_h * 0.06 * 300 / 24), width * 0.8);
app_container.style.width = width + "px";
app_container.style.height = height + buttonHeight + "px"; progress_bar_bg.style.marginLeft = -progress_bar_bg.width / 2 + "px";
game_canvas.width = width; progress_bar_fg.width = Math.ceil(progress_bar_bg.width * 1);
game_canvas.height = height;
progress_bar_fg.style.marginTop = (progress_bar_bg.width * 0) * (0) / 2 + "px";
// progress bar progress_bar_fg.style.marginLeft = -progress_bar_bg.width / 2 - progress_bar_fg.width / 2 + "px";
var bar_h = width < height ? width:height;
progress_bar_bg.width = Math.min(Math.ceil(bar_h * 0.06 * 300/24),width * 0.8); // progress_bar_text.style.fontSize = Math.ceil(bar_h * 0.10) + "px";
progress_bar_root.style.bottom = Math.ceil(height * 0.08 + buttonHeight) + "px";
progress_bar_bg.style.marginLeft = - progress_bar_bg.width/2 + "px"; }
progress_bar_fg.width = Math.ceil(progress_bar_bg.width * 1); resize_game_canvas();
window.addEventListener('resize', resize_game_canvas, false);
progress_bar_fg.style.marginTop = (progress_bar_bg.width * 0) * (0)/2 + "px"; window.addEventListener('orientationchange', resize_game_canvas, false);
progress_bar_fg.style.marginLeft = -progress_bar_bg.width/2 - progress_bar_fg.width/2 + "px"; // window.addEventListener('wheel', e => e.preventDefault(), { passive: false });
window.addEventListener("keydown", function(e) {
// progress_bar_text.style.fontSize = Math.ceil(bar_h * 0.10) + "px"; if ([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
progress_bar_root.style.bottom = Math.ceil(height*0.08 + buttonHeight) + "px"; e.preventDefault();
} }
resize_game_canvas(); }, false);
window.addEventListener('resize', resize_game_canvas, false); window.addEventListener('focus', resize_game_canvas, false);
window.addEventListener('orientationchange', resize_game_canvas, false);
// window.addEventListener('wheel', e => e.preventDefault(), { passive: false }); // HashSHA1 implementation
window.addEventListener("keydown", function(e) { !function() {
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) { var r = function(r) {
e.preventDefault(); for (var n = "", t = 7; t >= 0; t--)
} n += "0123456789abcdef".charAt(r >> 4 * t & 15);
}, false); return n
window.addEventListener('focus', resize_game_canvas, false); }
, n = function(r, n) {
// var t = (65535 & r) + (65535 & n);
// HashSHA1 implementation return (r >> 16) + (n >> 16) + (t >> 16) << 16 | 65535 & t
!function(){var r=function(r){for(var n="",t=7;t>=0;t--)n+="0123456789abcdef".charAt(r>>4*t&15);return n},n=function(r,n){var t=(65535&r)+(65535&n);return(r>>16)+(n>>16)+(t>>16)<<16|65535&t},e=function(r,n){return r<<n|r>>>32-n},o=function(r,n,t,e){return r<20?n&t|~n&e:r<40?n^t^e:r<60?n&t|n&e|t&e:n^t^e},u=function(r){return r<20?1518500249:r<40?1859775393:r<60?-1894007588:-899497514};window._HashSHA1=function(f){for(var a=function(r){for(var n=1+(r.length+8>>6),t=new Array(16*n),e=0;e<16*n;e++)t[e]=0;for(e=0;e<r.length;e++)t[e>>2]|=r.charCodeAt(e)<<24-e%4*8;return t[e>>2]|=128<<24-e%4*8,t[16*n-1]=8*r.length,t}(f),c=new Array(80),i=1732584193,h=-271733879,v=-1732584194,A=271733878,g=-1009589776,l=0;l<a.length;l+=16){for(var w=i,d=h,y=v,H=A,b=g,s=0;s<80;s++)c[s]=s<16?a[l+s]:e(c[s-3]^c[s-8]^c[s-14]^c[s-16],1),t=n(n(e(i,5),o(s,h,v,A)),n(n(g,c[s]),u(s))),g=A,A=v,v=e(h,30),h=i,i=t;i=n(i,w),h=n(h,d),v=n(v,y),A=n(A,H),g=n(g,b)}return r(i)+r(h)+r(v)+r(A)+r(g)}}(); }
// , e = function(r, n) {
return r << n | r >>> 32 - n
var old_preloadAndCallMain = Module._preloadAndCallMain; }
Module._preloadAndCallMain = function () { , o = function(r, n, t, e) {
// return r < 20 ? n & t | ~n & e : r < 40 ? n ^ t ^ e : r < 60 ? n & t | n & e | t & e : n ^ t ^ e
// Delete all LiveUpdate files stored in IDBFS }
var dir = DMSYS.GetUserPersistentDataRoot(); , u = function(r) {
var resDir = _HashSHA1("MonkeyMart"); return r < 20 ? 1518500249 : r < 40 ? 1859775393 : r < 60 ? -1894007588 : -899497514
try { };
FS.unlink(dir + "/." + resDir + "/liveupdate.arcd"); window._HashSHA1 = function(f) {
} catch (e) {} for (var a = function(r) {
try { for (var n = 1 + (r.length + 8 >> 6), t = new Array(16 * n), e = 0; e < 16 * n; e++)
FS.unlink(dir + "/." + resDir + "/liveupdate.arci"); t[e] = 0;
} catch (e) {} for (e = 0; e < r.length; e++)
try { t[e >> 2] |= r.charCodeAt(e) << 24 - e % 4 * 8;
FS.unlink(dir + "/." + resDir + "/liveupdate.arci.tmp"); return t[e >> 2] |= 128 << 24 - e % 4 * 8,
} catch (e) {} t[16 * n - 1] = 8 * r.length,
try { t
FS.unlink(dir + "/." + resDir + "/liveupdate.mounts"); }(f), c = new Array(80), i = 1732584193, h = -271733879, v = -1732584194, A = 271733878, g = -1009589776, l = 0; l < a.length; l += 16) {
} catch (e) {} for (var w = i, d = h, y = v, H = A, b = g, s = 0; s < 80; s++)
// c[s] = s < 16 ? a[l + s] : e(c[s - 3] ^ c[s - 8] ^ c[s - 14] ^ c[s - 16], 1),
t = n(n(e(i, 5), o(s, h, v, A)), n(n(g, c[s]), u(s))),
if (Module._archiveLoaded) { g = A,
// A = v,
} v = e(h, 30),
old_preloadAndCallMain(); h = i,
}; i = t;
</script> i = n(i, w),
<script id="engine-start" type="text/javascript"> h = n(h, d),
var currentPercentage = 0 v = n(v, y),
A = n(A, H),
Progress.updateProgress = function(percentage) { g = n(g, b)
Progress.notifyListeners(percentage); }
if(currentPercentage>percentage){ return r(i) + r(h) + r(v) + r(A) + r(g)
percentage = currentPercentage }
} }();
currentPercentage = percentage
// var progress_bar_text = document.getElementById('progress-bar-text'); // Delete all LiveUpdate files stored in IDBFS
// progress_bar_text.innerHTML = "<b>" + Math.ceil(percentage) + "%</b>"; var old_preloadAndCallMain = Module._preloadAndCallMain;
Module._preloadAndCallMain = function() {
var fg = document.getElementById('progress-bar-fg'); var dir = DMSYS.GetUserPersistentDataRoot();
fg.style.clip="rect(0px," + fg.width * percentage/100 + "px," + fg.height+"px," + "0px)" var resDir = _HashSHA1("MonkeyMart");
try {
if(isNaN(percentage)){ FS.unlink(dir + "/." + resDir + "/liveupdate.arcd");
var progress_bar_root = document.getElementById('progress-bar-root'); } catch (e) {}
progress_bar_root.style.visibility = "hidden"; try {
} FS.unlink(dir + "/." + resDir + "/liveupdate.arci");
}; } catch (e) {}
Progress.addProgress = function (){ try {
var progress_bar_root = document.getElementById('progress-bar-root'); FS.unlink(dir + "/." + resDir + "/liveupdate.arci.tmp");
progress_bar_root.style.visibility = "visible" } catch (e) {}
} old_preloadAndCallMain();
Progress.removeProgress = function () {
var progress_bar_root = document.getElementById('progress-bar-root'); if (Module._archiveLoaded) {//
progress_bar_root.style.visibility = "hidden"; }
// Remove any background/splash image that was set in runApp(). }
// Workaround for Safari bug DEF-3061. ;
Module.canvas.style.background = ""; </script>
} <script id="engine-start" type="text/javascript">
var currentPercentage = 0
EngineLoader.stream_wasm = "false" === "true";
EngineLoader.load("canvas", "MonkeyMart"); Progress.updateProgress = function(percentage) {
</script> Progress.notifyListeners(percentage);
<script type="text/javascript"> if (currentPercentage > percentage) {
function poki_showBanner(vBanner) { percentage = currentPercentage
PokiSDK.displayAd(document.getElementById(vBanner), '320x50'); }
} currentPercentage = percentage
// var progress_bar_text = document.getElementById('progress-bar-text');
function poki_showBigBanner(vBanner) { // progress_bar_text.innerHTML = "<b>" + Math.ceil(percentage) + "%</b>";
PokiSDK.displayAd(document.getElementById(vBanner), '728x90');
} var fg = document.getElementById('progress-bar-fg');
fg.style.clip = "rect(0px," + fg.width * percentage / 100 + "px," + fg.height + "px," + "0px)"
function poki_hideBanner(vBanner) {
PokiSDK.destroyAd(document.getElementById(vBanner)); if (isNaN(percentage)) {
} var progress_bar_root = document.getElementById('progress-bar-root');
</script> progress_bar_root.style.visibility = "hidden";
<script id="poki-sdk-setup" type="text/javascript"> }
PokiSDK.gameLoadingStart(); }
var data = {}; ;
var isLoadFinished = false; Progress.addProgress = function() {
Progress.addListener(function(percentage){ var progress_bar_root = document.getElementById('progress-bar-root');
data.percentageDone = percentage / 100; progress_bar_root.style.visibility = "visible"
if (!isLoadFinished) }
PokiSDK.gameLoadingProgress(data); Progress.removeProgress = function() {
if (percentage == 100 && !isLoadFinished) { var progress_bar_root = document.getElementById('progress-bar-root');
PokiSDK.gameLoadingFinished(); progress_bar_root.style.visibility = "hidden";
isLoadFinished = true; // Remove any background/splash image that was set in runApp().
} // Workaround for Safari bug DEF-3061.
}); Module.canvas.style.background = "";
Module['onRuntimeInitialized'] = function() { }
PokiSDK.init().then(()=>{
Module.runApp("canvas", extra_params); EngineLoader.stream_wasm = "false" === "true";
}).catch(()=>{ EngineLoader.load("canvas", "MonkeyMart");
Module.runApp("canvas", extra_params); </script>
}); <script type="text/javascript">
}; function poki_showBanner(vBanner) {}
</script>
<script type="text/javascript" src="GameAnalytics.js"></script> function poki_showBigBanner(vBanner) {}
</body>
</html> function poki_hideBanner(vBanner) {}
function poki_check() {
}
</script>
<script id="poki-sdk-setup" type="text/javascript">
var data = {};
var isLoadFinished = false;
Progress.addListener(function(percentage) {
data.percentageDone = percentage / 100;
if (!isLoadFinished)
if (percentage == 100 && !isLoadFinished) {
isLoadFinished = true;
}
});
Module['onRuntimeInitialized'] = function() {
Module.runApp("canvas", extra_params);
}
;
</script>
<script src="GameAnalytics.js" type="text/javascript"></script>
</body>
</html>
-126
View File
@@ -1,126 +0,0 @@
(() => {
"use strict";
function e() {
var e;
try {
e = performance.getEntriesByType("resource").map((function(e) {
return e.transferSize
})).reduce((function(e, t) {
return e + t
})), e += performance.getEntriesByType("navigation")[0].transferSize
} catch (e) {}
return e
}
var t = function(e) {
var t = RegExp("[?&]".concat(e, "=([^&]*)")).exec(window.location.search);
return t && decodeURIComponent(t[1].replace(/\+/g, " "))
},
n = "kids" === t("tag"),
o = !!window.adBridge,
r = "yes" === t("hoist") || "yes" === t("gdhoist"),
i = new(function() {
function e() {
var e = this;
this.queue = [], this.init = function(t, n) {
return void 0 === t && (t = {}), void 0 === n && (n = {}), new Promise((function(o, r) {
e.enqueue("init", [t, n], o, r)
}))
}, this.rewardedBreak = function() {
return new Promise((function(e) {
e(!1)
}))
}, this.commercialBreak = function(t) {
return new Promise((function(n, o) {
e.enqueue("commercialBreak", [t], n, o)
}))
}, this.displayAd = function(e, t, n, o) {
o && o(!0), n && n()
}, this.withArguments = function(t) {
return function() {
for (var n = [], o = 0; o < arguments.length; o++) n[o] = arguments[o];
e.enqueue(t, n)
}
}, this.handleAutoResolvePromise = function() {
return new Promise((function(e) {
e()
}))
}, this.throwNotLoaded = function() {
console.debug("PokiSDK is not loaded yet. Not all methods are available.")
}, this.doNothing = function() {}
}
return e.prototype.enqueue = function(e, t, o, r) {
var i = {
fn: e,
args: t || [],
resolveFn: o,
rejectFn: r
};
n ? o && o(!0) : this.queue.push(i)
}, e.prototype.dequeue = function() {
for (var e = this, t = function() {
var t, o, r = n.queue.shift(),
i = r,
a = i.fn,
c = i.args;
if ("function" == typeof window.PokiSDK[a])
if ((null == r ? void 0 : r.resolveFn) || (null == r ? void 0 : r.rejectFn)) {
var u = "init" === a;
if ((t = window.PokiSDK)[a].apply(t, c).catch((function() {
for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
"function" == typeof r.rejectFn && r.rejectFn.apply(r, t), u && setTimeout((function() {
e.dequeue()
}), 0)
})).then((function() {
for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
"function" == typeof r.resolveFn && r.resolveFn.apply(r, t), u && setTimeout((function() {
e.dequeue()
}), 0)
})), u) return "break"
} else(o = window.PokiSDK)[a].apply(o, c);
else console.error("Cannot execute ".concat(a))
}, n = this; this.queue.length > 0;) {
if ("break" === t()) break
}
}, e
}());
window.PokiSDK = {
init: i.init,
initWithVideoHB: i.init,
commercialBreak: i.commercialBreak,
rewardedBreak: i.rewardedBreak,
displayAd: i.displayAd,
destroyAd: i.doNothing,
getLeaderboard: i.handleAutoResolvePromise,
shareableURL: function() {
return new Promise((function(e, t) {
return t()
}))
},
getURLParam: function(e) {
return t("gd".concat(e)) || t(e) || ""
},
getLanguage: function() {
return navigator.language.toLowerCase().split("-")[0]
},
isAdBlocked: function() {}
}, ["captureError", "customEvent", "gameInteractive", "gameLoadingFinished", "gameLoadingProgress", "gameLoadingStart", "gameplayStart", "gameplayStop", "happyTime", "logError", "muteAd", "roundEnd", "roundStart", "sendHighscore", "setDebug", "setDebugTouchOverlayController", "setLogging", "setPlayerAge", "setPlaytestCanvas", "enableEventTracking", "playtestSetCanvas", "playtestCaptureHtmlOnce"].forEach((function(e) {
window.PokiSDK[e] = i.withArguments(e)
})), o || n || (window.pokiCancelProgressInterval = setInterval((function() {
window.parent.postMessage({
type: "pokiProgress",
downloaded: e()
}, "*")
}), 1e3));
var a = function() {
var e = window.pokiSDKVersion || t("ab") || "ea3bf7fbf0b66afafd7ac6ecbb583b3045005c15",
i = "poki-sdk-core-".concat(e, ".js");
n && (i = "poki-sdk-kids-".concat(e, ".js")), o && (i = "poki-sdk-playground-".concat(e, ".js")), r && (i = "poki-sdk-hoist-".concat(e, ".js"));
new URL(document.currentScript.src);
return "js/".concat(e, "/").concat(i)
}(),
c = document.createElement("script");
c.setAttribute("src", a), c.setAttribute("type", "text/javascript"), c.setAttribute("crossOrigin", "anonymous"), c.onload = function() {
return i.dequeue()
}, document.head.appendChild(c)
})();
Binary file not shown.