monkey mart update

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

After

Width:  |  Height:  |  Size: 151 KiB

+114 -123
View File
@@ -109,12 +109,8 @@ var EngineLoader = {
loadAndInstantiateWasmAsync: function(src, fromProgress, toProgress, callback) {
FileLoader.load(src, "arraybuffer", EngineLoader.wasm_size,
function(loaded, total) {
Progress.calculateProgress(fromProgress, toProgress, loaded, total);
},
function(error) {
throw error;
},
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); },
function(error) { throw error; },
function(wasm) {
Module.instantiateWasm = function(imports, successCallback) {
var wasmInstantiate = WebAssembly.instantiate(new Uint8Array(wasm), imports).then(function(output) {
@@ -136,12 +132,15 @@ var EngineLoader = {
async function fetchWithProgress(path) {
const response = await fetch(path);
// May be incorrect if compressed
const contentLength = response.headers.get("Content-Length");
var contentLength = response.headers.get("Content-Length");
if (!contentLength){
contentLength = EngineLoader.wasm_size;
}
const total = parseInt(contentLength, 10);
let bytesLoaded = 0;
const ts = new TransformStream({
transform(chunk, controller) {
transform (chunk, controller) {
bytesLoaded += chunk.byteLength;
Progress.calculateProgress(fromProgress, toProgress, bytesLoaded, total);
controller.enqueue(chunk)
@@ -171,7 +170,8 @@ var EngineLoader = {
if (EngineLoader.stream_wasm && (typeof WebAssembly.instantiateStreaming === "function")) {
EngineLoader.setupWasmStreamAsync(exeName + ".wasm", 10, 50);
EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 0, 10);
} else {
}
else {
EngineLoader.loadAndInstantiateWasmAsync(exeName + ".wasm", 0, 40, function() {
EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 40, 50);
});
@@ -185,16 +185,12 @@ var EngineLoader = {
// load and start engine script (asm.js or wasm.js)
loadAndRunScriptAsync: function(src, estimatedSize, fromProgress, toProgress) {
FileLoader.load(src, "text", estimatedSize,
function(loaded, total) {
Progress.calculateProgress(fromProgress, toProgress, loaded, total);
},
function(error) {
throw error;
},
function(loaded, total) { Progress.calculateProgress(fromProgress, toProgress, loaded, total); },
function(error) { throw error; },
function(response) {
var tag = document.createElement("script");
tag.text = response;
document.head.appendChild(tag);
document.body.appendChild(tag);
});
},
@@ -230,21 +226,19 @@ var GameArchiveLoader = {
//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.
_onArchiveLoadedListeners: [], // signature: void
_onFileDownloadErrorListeners: [], // signature: name
_onFileLoadedListeners: [], // signature: name, data.
_onArchiveLoadedListeners:[], // signature: void
_onFileDownloadErrorListeners: [], // signature: name
_currentDownloadBytes: 0,
_totalDownloadBytes: 0,
_archiveLocationFilter: function(path) {
return "split" + path;
},
_archiveLocationFilter: function(path) { return "split" + path; },
cleanUp: function() {
this._files = [];
this._files = [];
this._fileIndex = 0;
this.isCompleted = false;
this._onGameArchiveLoaderCompletedListeners = [];
@@ -260,7 +254,7 @@ var GameArchiveLoader = {
list.push(callback);
},
notifyListeners: function(list, data) {
for (i = 0; i < list.length; ++i) {
for (i=0; i<list.length; ++i) {
list[i](data);
}
},
@@ -276,10 +270,7 @@ var GameArchiveLoader = {
this.addListener(this._onFileLoadedListeners, callback);
},
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) {
@@ -302,13 +293,9 @@ var GameArchiveLoader = {
this._archiveLocationFilter(descriptionUrl),
"json",
undefined,
function(loaded, total) {},
function(error) {
GameArchiveLoader.notifyFileDownloadError(descriptionUrl);
},
function(json) {
GameArchiveLoader.onReceiveDescription(json);
});
function (loaded, total) { },
function (error) { GameArchiveLoader.notifyFileDownloadError(descriptionUrl); },
function (json) { GameArchiveLoader.onReceiveDescription(json); });
},
onReceiveDescription: function(json) {
@@ -317,7 +304,7 @@ var GameArchiveLoader = {
this._currentDownloadBytes = 0;
// 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.downloadContent();
@@ -335,7 +322,7 @@ var GameArchiveLoader = {
limit = Math.min(limit, this.MAX_CONCURRENT_XHR);
}
// download pieces
for (var i = 0; i < limit; ++i) {
for (var i=0; i<limit; ++i) {
this.downloadPiece(file, i);
}
},
@@ -359,16 +346,16 @@ var GameArchiveLoader = {
FileLoader.load(
url, "arraybuffer", undefined,
function(loaded, total) {
function (loaded, total) {
var delta = loaded - downloaded;
downloaded = loaded;
GameArchiveLoader._currentDownloadBytes += delta;
GameArchiveLoader.notifyDownloadProgress();
},
function(error) {
function (error) {
GameArchiveLoader.notifyFileDownloadError(error);
},
function(response) {
function (response) {
piece.data = new Uint8Array(response);
piece.dataLength = piece.data.length;
total = piece.dataLength;
@@ -416,18 +403,18 @@ var GameArchiveLoader = {
verifyFile: function(file) {
// verify that we downloaded as much as we were supposed to
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;
}
// if (actualSize != file.size) {
// throw "Unexpected data size";
// }
if (actualSize != file.size) {
throw "Unexpected data size";
}
// verify the pieces
if (file.pieces.length > 1) {
var output = file.data;
var pieces = file.pieces;
for (i = 0; i < pieces.length; ++i) {
for (i=0; i<pieces.length; ++i) {
var item = pieces[i];
// Bounds check
var start = item.offset;
@@ -481,12 +468,12 @@ var Progress = {
},
notifyListeners: function(percentage) {
for (i = 0; i < this.listeners.length; ++i) {
for (i=0; i<this.listeners.length; ++i) {
this.listeners[i](percentage);
}
},
addProgress: function(canvas) {
addProgress : function (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>');
Progress.bar = document.getElementById(Progress.bar_id);
@@ -495,16 +482,16 @@ var Progress = {
updateProgress: function(percentage) {
if (Progress.bar) {
Progress.bar.style.width = percentage + "%";
Progress.bar.style.width = Math.min(percentage, 100) + "%";
}
Progress.notifyListeners(percentage);
},
calculateProgress: function(from, to, current, total) {
calculateProgress: function (from, to, current, total) {
this.updateProgress(from + (current / total) * (to - from));
},
removeProgress: function() {
removeProgress: function () {
if (Progress.progress.parentElement !== null) {
Progress.progress.parentElement.removeChild(Progress.progress);
@@ -537,16 +524,10 @@ var Module = {
arguments: [],
print: function(text) {
console.log(text);
},
printErr: function(text) {
console.error(text);
},
print: function(text) { console.log(text); },
printErr: function(text) { console.error(text); },
setStatus: function(text) {
console.log(text);
},
setStatus: function(text) { console.log(text); },
isWASMSupported: (function() {
try {
@@ -555,17 +536,18 @@ var Module = {
if (module instanceof WebAssembly.Module)
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
}
} catch (e) {}
} catch (e) {
}
return false;
})(),
prepareErrorObject: function(err, url, line, column, errObj) {
prepareErrorObject: function (err, url, line, column, errObj) {
line = typeof line == "undefined" ? 0 : line;
column = typeof column == "undefined" ? 0 : column;
url = typeof url == "undefined" ? "" : url;
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 stack = "";
var backtrace = "";
@@ -593,10 +575,7 @@ var Module = {
stack = stack.replace(/^((?:Object|Array)\.)/gm, "");
stack = stack.split("\n");
return {
stack: stack,
message: message
};
return { stack:stack, message:message };
},
hasWebGLSupport: function() {
@@ -623,44 +602,42 @@ var Module = {
/**
* Module.runApp - Starts the application given a canvas element id
*
* 'extra_params' is an optional object that can have the following fields:
*
* 'archive_location_filter':
* Filter function that will run for each archive path.
*
* 'unsupported_webgl_callback':
* Function that is called if WebGL is not supported.
*
* 'engine_arguments':
* List of arguments (strings) that will be passed to the engine.
*
* 'persistent_storage':
* Boolean toggling the usage of persistent storage.
*
* 'custom_heap_size':
* Number of bytes specifying the memory heap size.
*
* 'disable_context_menu':
* Disables the right-click context menu on the canvas element if true.
*
* 'retry_time':
* Pause before retry file loading after error.
*
* 'retry_count':
* How many attempts we do when trying to download a file.
*
* 'can_not_download_file_callback':
* Function that is called if you can't download file after 'retry_count' attempts.
**/
* Module.runApp - Starts the application given a canvas element id
*
* 'extra_params' is an optional object that can have the following fields:
*
* 'archive_location_filter':
* Filter function that will run for each archive path.
*
* 'unsupported_webgl_callback':
* Function that is called if WebGL is not supported.
*
* 'engine_arguments':
* List of arguments (strings) that will be passed to the engine.
*
* 'persistent_storage':
* Boolean toggling the usage of persistent storage.
*
* 'custom_heap_size':
* Number of bytes specifying the memory heap size.
*
* 'disable_context_menu':
* Disables the right-click context menu on the canvas element if true.
*
* 'retry_time':
* Pause before retry file loading after error.
*
* 'retry_count':
* How many attempts we do when trying to download a file.
*
* 'can_not_download_file_callback':
* Function that is called if you can't download file after 'retry_count' attempts.
**/
runApp: function(appCanvasId, extra_params) {
Module.setupCanvas(appCanvasId);
var params = {
archive_location_filter: function(path) {
return 'split' + path;
},
archive_location_filter: function(path) { return 'split' + path; },
unsupported_webgl_callback: undefined,
engine_arguments: [],
persistent_storage: true,
@@ -690,7 +667,8 @@ var Module = {
Module.canvas.focus();
// Add context menu hide-handler if requested
if (params["disable_context_menu"]) {
if (params["disable_context_menu"])
{
Module.canvas.oncontextmenu = function(e) {
e.preventDefault();
};
@@ -719,10 +697,7 @@ var Module = {
},
onArchiveFileLoaded: function(file) {
Module._filesToPreload.push({
path: file.name,
data: file.data
});
Module._filesToPreload.push({path: file.name, data: file.data});
},
onArchiveLoaded: function() {
@@ -744,11 +719,16 @@ var Module = {
},
preSync: function(done) {
if (Module.persistentStorage != true) {
Module._syncInitial = true;
done();
return;
}
// Initial persistent sync before main is called
FS.syncfs(true, function(err) {
if (err) {
Module._syncTries += 1;
console.error("FS syncfs error: " + err);
console.warn("Unable to synchronize mounted file systems: " + err);
if (Module._syncMaxTries > Module._syncTries) {
Module.preSync(done);
} else {
@@ -779,6 +759,9 @@ var Module = {
// It will flag that another one is needed if there is already one sync running.
persistentSync: function() {
if (Module.persistentStorage != true) {
return;
}
// Need to wait for the initial sync to finish since it
// will call close on all its file streams which will trigger
// new persistentSync for each.
@@ -792,17 +775,22 @@ var Module = {
},
preInit: [function() {
/* Mount filesystem on preinit */
// Mount filesystem on preinit
var dir = DMSYS.GetUserPersistentDataRoot();
FS.mkdir(dir);
try {
FS.mkdir(dir);
}
catch (error) {
Module.persistentStorage = false;
Module._preloadAndCallMain();
return;
}
// 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
// previously saved data before boot.
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
if (Module.persistentStorage && window.indexedDB) {
try {
FS.mount(IDBFS, {}, dir);
// Patch FS.close so it will try to sync MEM->IDB
var _close = FS.close;
FS.close = function(stream) {
@@ -810,25 +798,28 @@ var Module = {
Module.persistentSync();
return r;
}
// Sync IDB->MEM before calling main()
Module.preSync(function() {
Module._preloadAndCallMain();
});
} else {
Module._preloadAndCallMain();
}
catch (error) {
Module.persistentStorage = false;
Module._preloadAndCallMain();
return;
}
// Sync IDB->MEM before calling main()
Module.preSync(function() {
Module._preloadAndCallMain();
});
}],
preRun: [function() {
/* If archive is loaded, preload all its files */
if (Module._archiveLoaded) {
if(Module._archiveLoaded) {
Module.preloadAll();
}
}],
postRun: [function() {
if (Module._archiveLoaded) {
if(Module._archiveLoaded) {
Progress.removeProgress();
}
}],
@@ -859,7 +850,7 @@ var Module = {
Module._syncInProgress = false;
if (err) {
console.error("Module._startSyncFS error: " + err);
console.warn("Unable to synchronize mounted file systems: " + err);
Module._syncTries += 1;
}
@@ -882,4 +873,4 @@ window.onerror = function(err, url, line, column, errObj) {
Module.setStatus = function(text) {
if (text) Module.printErr('[post-exception status] ' + text);
};
};
};
+363 -386
View File
@@ -1,386 +1,363 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, minimal-ui, shrink-to-fit=no" name="viewport"/>
<meta content="yes" name="apple-mobile-web-app-capable"/>
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Monkey Mart</title>
<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"/>
<script src="Jump_Game.js" type="text/javascript"></script>
<style type="text/css">
/* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would
* drag the selected text but block mouse down/up events to the engine.
*/
body {
position: fixed;
/* Prevent overscroll */
margin: 0;
padding: 0;
}
.canvas-app-container {
width: 100%;
height: 100%;
position: absolute;
align-items: center;
justify-content: center;
overflow: hidden;
}
.canvas-app-container:-webkit-full-screen {
/* Auto width and height in Safari/Chrome fullscreen. */
width: auto;
height: auto;
}
#canvas {
outline: none;
border: 0;
width: 100%;
vertical-align: bottom;
}
#canvas-container {
position: relative;
}
canvas:focus, canvas:active {
outline: 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;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.banner-styleBottom {
margin: 0 auto;
position: fixed;
bottom: 0;
display: block;
left: 50%;
transform: translateX(-50%);
}
.banner-styleTop {
margin: 0 auto;
position: fixed;
top: 0;
display: block;
left: 50%;
transform: translateX(-50%);
}
.canvas-app-progress {
position: absolute;
background-color: #0A8A40;
height: 30px;
margin-top: -30px;
width: 100%;
}
.canvas-app-progress-bar {
font-size: 12px;
height: 30px;
color: rgb(255, 255, 255);
background-color: #FFE333;
text-align: center;
line-height: 20px;
}
.link, .button {
font-family: sans-serif;
font-size: 14px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 0px;
padding-top: 12px;
}
.buttons-background {
background-color: #ffffff;
width: 100%;
height: 42px;
}
body {
background-color: #ffffff;
}
.canvas-app-container {
background: #00BB61;
/* 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-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: -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: -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: -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: 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;
background-position: center;
background-position: top;
background-size: cover;
background-image: url("bg_loading.png");
}
</style>
</head>
<body>
<div class="canvas-app-container" id="app-container">
<div class="canvas-app-canvas-container" id="canvas-container">
<canvas class="canvas-app-canvas" height="640" id="canvas" tabindex="1" width="960"></canvas>
</div>
<div class="buttons-background"></div>
<!-- center and anchor to bottom of page -->
<div id="progress-bar-root" style="position: absolute; bottom: 16%; left: 50%; visibility: hidden; z-index: 4;">
<!-- <div id="progress-bar-text"> -->
<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>
</div>
<!-- -->
<!-- <div id="bannerTop" class="banner-styleTop"></div> -->
<!-- <div id="bannerBottom" class="banner-styleBottom"></div> -->
<!-- -->
<script id="engine-loader" src="dmloader.js" type="text/javascript"></script>
<!-- -->
<script id="engine-setup" type="text/javascript">
var extra_params = {
archive_location_filter: function(path) {
return ("archive" + path + "");
},
engine_arguments: ["--verify-graphics-calls=false", ],
custom_heap_size: 67108864,
full_screen_container: "#canvas-container",
disable_context_menu: true
}
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.
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 prevInnerHeight = -1;
function resize_game_canvas() {
// Hack for iOS when exit from Fullscreen mode
if (is_iOS) {
window.scrollTo(0, 0);
}
var app_container = document.getElementById('app-container');
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 progress_bar_bg = document.getElementById('progress-bar-bg');
var innerWidth = window.innerWidth;
var innerHeight = window.innerHeight - buttonHeight;
if (prevInnerWidth == innerWidth && prevInnerHeight == innerHeight) {
return;
}
prevInnerWidth = innerWidth;
prevInnerHeight = innerHeight;
var width = 960;
var height = 640;
var targetRatio = width / height;
var actualRatio = innerWidth / innerHeight;
//Stretch
width = innerWidth;
height = innerHeight;
app_container.style.width = width + "px";
app_container.style.height = height + buttonHeight + "px";
game_canvas.width = width;
game_canvas.height = height;
// 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);
progress_bar_bg.style.marginLeft = -progress_bar_bg.width / 2 + "px";
progress_bar_fg.width = Math.ceil(progress_bar_bg.width * 1);
progress_bar_fg.style.marginTop = (progress_bar_bg.width * 0) * (0) / 2 + "px";
progress_bar_fg.style.marginLeft = -progress_bar_bg.width / 2 - progress_bar_fg.width / 2 + "px";
// progress_bar_text.style.fontSize = Math.ceil(bar_h * 0.10) + "px";
progress_bar_root.style.bottom = Math.ceil(height * 0.08 + buttonHeight) + "px";
}
resize_game_canvas();
window.addEventListener('resize', resize_game_canvas, false);
window.addEventListener('orientationchange', resize_game_canvas, false);
// window.addEventListener('wheel', e => e.preventDefault(), { passive: false });
window.addEventListener("keydown", function(e) {
if ([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
}, false);
window.addEventListener('focus', resize_game_canvas, false);
// HashSHA1 implementation
!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)
}
}();
// Delete all LiveUpdate files stored in IDBFS
var old_preloadAndCallMain = Module._preloadAndCallMain;
Module._preloadAndCallMain = function() {
var dir = DMSYS.GetUserPersistentDataRoot();
var resDir = _HashSHA1("MonkeyMart");
try {
FS.unlink(dir + "/." + resDir + "/liveupdate.arcd");
} catch (e) {}
try {
FS.unlink(dir + "/." + resDir + "/liveupdate.arci");
} catch (e) {}
try {
FS.unlink(dir + "/." + resDir + "/liveupdate.arci.tmp");
} catch (e) {}
old_preloadAndCallMain();
if (Module._archiveLoaded) {//
}
}
;
</script>
<script id="engine-start" type="text/javascript">
var currentPercentage = 0
Progress.updateProgress = function(percentage) {
Progress.notifyListeners(percentage);
if (currentPercentage > percentage) {
percentage = currentPercentage
}
currentPercentage = percentage
// var progress_bar_text = document.getElementById('progress-bar-text');
// progress_bar_text.innerHTML = "<b>" + Math.ceil(percentage) + "%</b>";
var fg = document.getElementById('progress-bar-fg');
fg.style.clip = "rect(0px," + fg.width * percentage / 100 + "px," + fg.height + "px," + "0px)"
if (isNaN(percentage)) {
var progress_bar_root = document.getElementById('progress-bar-root');
progress_bar_root.style.visibility = "hidden";
}
}
;
Progress.addProgress = function() {
var progress_bar_root = document.getElementById('progress-bar-root');
progress_bar_root.style.visibility = "visible"
}
Progress.removeProgress = function() {
var progress_bar_root = document.getElementById('progress-bar-root');
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 = "";
}
EngineLoader.stream_wasm = "false" === "true";
EngineLoader.load("canvas", "MonkeyMart");
</script>
<script type="text/javascript">
function poki_showBanner(vBanner) {}
function poki_showBigBanner(vBanner) {}
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>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<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 name="apple-mobile-web-app-capable" content="yes">
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Monkey Mart</title>
<style type="text/css">
/* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would
* drag the selected text but block mouse down/up events to the engine.
*/
body {
position: fixed; /* Prevent overscroll */
margin:0;
padding:0;
}
.canvas-app-container {
width: 100%;
height: 100%;
position: absolute;
align-items: center;
justify-content: center;
overflow: hidden;
}
.canvas-app-container:-webkit-full-screen {
/* Auto width and height in Safari/Chrome fullscreen. */
width: auto;
height: auto;
}
#canvas {
outline: none;
border: 0;
width: 100%;
vertical-align: bottom;
}
#canvas-container {
position: relative;
}
canvas:focus, canvas:active {
outline: 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;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.banner-styleBottom {
margin: 0 auto;
position: fixed;
bottom: 0;
display: block;
left: 50%;
transform: translateX(-50%);
}
.banner-styleTop {
margin: 0 auto;
position: fixed;
top: 0;
display: block;
left: 50%;
transform: translateX(-50%);
}
.canvas-app-progress {
position: absolute;
background-color: #0A8A40;
height: 30px;
margin-top: -30px;
width: 100%;
}
.canvas-app-progress-bar {
font-size: 12px;
height: 30px;
color: rgb(255, 255, 255);
background-color: #FFE333;
text-align: center;
line-height: 20px;
}
.link, .button {
font-family: sans-serif;
font-size: 14px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 0px;
padding-top: 12px;
}
.buttons-background {
background-color: #ffffff;
width: 100%;
height: 42px;
}
body {
background-color: #ffffff;
}
.canvas-app-container {
background: #00BB61;
/* 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-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: -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: -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: -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: 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;
background-position: center;
background-position: top;
background-size: cover;
background-image: url("bg_loading.png");
}
</style>
<script src="js/poki-sdk.js"></script>
</head>
<body>
<div id="app-container" class="canvas-app-container">
<div id="canvas-container" class="canvas-app-canvas-container">
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="960" height="640"></canvas>
</div>
<div class="buttons-background">
</div>
<!-- center and anchor to bottom of page -->
<div id="progress-bar-root" style="position: absolute; bottom: 16%; left: 50%; visibility: hidden; z-index: 4;">
<!-- <div id="progress-bar-text"> -->
<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>
</div>
<!-- -->
<!-- <div id="bannerTop" class="banner-styleTop"></div> -->
<!-- <div id="bannerBottom" class="banner-styleBottom"></div> -->
<!-- -->
<script id="engine-loader" type="text/javascript" src="dmloader.js"></script>
<!-- -->
<script id="engine-setup" type="text/javascript">
var extra_params = {
archive_location_filter: function( path ) {
return ("archive" + path + "");
},
engine_arguments: ["--verify-graphics-calls=false",],
custom_heap_size: 134217728,
full_screen_container: "#canvas-container",
disable_context_menu: true
}
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.
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 prevInnerHeight = -1;
function resize_game_canvas() {
// Hack for iOS when exit from Fullscreen mode
if (is_iOS) {
window.scrollTo(0, 0);
}
var app_container = document.getElementById('app-container');
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 progress_bar_bg = document.getElementById('progress-bar-bg');
var innerWidth = window.innerWidth;
var innerHeight = window.innerHeight - buttonHeight;
if (prevInnerWidth == innerWidth && prevInnerHeight == innerHeight)
{
return;
}
prevInnerWidth = innerWidth;
prevInnerHeight = innerHeight;
var width = 960;
var height = 640;
var targetRatio = width / height;
var actualRatio = innerWidth / innerHeight;
//Stretch
width = innerWidth;
height = innerHeight;
app_container.style.width = width + "px";
app_container.style.height = height + buttonHeight + "px";
game_canvas.width = width;
game_canvas.height = height;
// 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);
progress_bar_bg.style.marginLeft = - progress_bar_bg.width/2 + "px";
progress_bar_fg.width = Math.ceil(progress_bar_bg.width * 1);
progress_bar_fg.style.marginTop = (progress_bar_bg.width * 0) * (0)/2 + "px";
progress_bar_fg.style.marginLeft = -progress_bar_bg.width/2 - progress_bar_fg.width/2 + "px";
// progress_bar_text.style.fontSize = Math.ceil(bar_h * 0.10) + "px";
progress_bar_root.style.bottom = Math.ceil(height*0.08 + buttonHeight) + "px";
}
resize_game_canvas();
window.addEventListener('resize', resize_game_canvas, false);
window.addEventListener('orientationchange', resize_game_canvas, false);
// window.addEventListener('wheel', e => e.preventDefault(), { passive: false });
window.addEventListener("keydown", function(e) {
if([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
}, false);
window.addEventListener('focus', resize_game_canvas, false);
//
// HashSHA1 implementation
!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)}}();
//
var old_preloadAndCallMain = Module._preloadAndCallMain;
Module._preloadAndCallMain = function () {
//
// Delete all LiveUpdate files stored in IDBFS
var dir = DMSYS.GetUserPersistentDataRoot();
var resDir = _HashSHA1("MonkeyMart");
try {
FS.unlink(dir + "/." + resDir + "/liveupdate.arcd");
} catch (e) {}
try {
FS.unlink(dir + "/." + resDir + "/liveupdate.arci");
} catch (e) {}
try {
FS.unlink(dir + "/." + resDir + "/liveupdate.arci.tmp");
} catch (e) {}
try {
FS.unlink(dir + "/." + resDir + "/liveupdate.mounts");
} catch (e) {}
//
if (Module._archiveLoaded) {
//
}
old_preloadAndCallMain();
};
</script>
<script id="engine-start" type="text/javascript">
var currentPercentage = 0
Progress.updateProgress = function(percentage) {
Progress.notifyListeners(percentage);
if(currentPercentage>percentage){
percentage = currentPercentage
}
currentPercentage = percentage
// var progress_bar_text = document.getElementById('progress-bar-text');
// progress_bar_text.innerHTML = "<b>" + Math.ceil(percentage) + "%</b>";
var fg = document.getElementById('progress-bar-fg');
fg.style.clip="rect(0px," + fg.width * percentage/100 + "px," + fg.height+"px," + "0px)"
if(isNaN(percentage)){
var progress_bar_root = document.getElementById('progress-bar-root');
progress_bar_root.style.visibility = "hidden";
}
};
Progress.addProgress = function (){
var progress_bar_root = document.getElementById('progress-bar-root');
progress_bar_root.style.visibility = "visible"
}
Progress.removeProgress = function () {
var progress_bar_root = document.getElementById('progress-bar-root');
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 = "";
}
EngineLoader.stream_wasm = "false" === "true";
EngineLoader.load("canvas", "MonkeyMart");
</script>
<script type="text/javascript">
function poki_showBanner(vBanner) {
PokiSDK.displayAd(document.getElementById(vBanner), '320x50');
}
function poki_showBigBanner(vBanner) {
PokiSDK.displayAd(document.getElementById(vBanner), '728x90');
}
function poki_hideBanner(vBanner) {
PokiSDK.destroyAd(document.getElementById(vBanner));
}
</script>
<script id="poki-sdk-setup" type="text/javascript">
PokiSDK.gameLoadingStart();
var data = {};
var isLoadFinished = false;
Progress.addListener(function(percentage){
data.percentageDone = percentage / 100;
if (!isLoadFinished)
PokiSDK.gameLoadingProgress(data);
if (percentage == 100 && !isLoadFinished) {
PokiSDK.gameLoadingFinished();
isLoadFinished = true;
}
});
Module['onRuntimeInitialized'] = function() {
PokiSDK.init().then(()=>{
Module.runApp("canvas", extra_params);
}).catch(()=>{
Module.runApp("canvas", extra_params);
});
};
</script>
<script type="text/javascript" src="GameAnalytics.js"></script>
</body>
</html>
+126
View File
@@ -0,0 +1,126 @@
(() => {
"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.