From 5228c9b5345121c7aa00b1ea9412201165907aa9 Mon Sep 17 00:00:00 2001 From: Ben Wiley Date: Fri, 29 Jan 2016 09:50:18 -0500 Subject: [PATCH 1/6] Collision points only generated on Sprite update if points exist. --- lib/quintus_sprites.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/quintus_sprites.js b/lib/quintus_sprites.js index 37403abb..f6b17174 100644 --- a/lib/quintus_sprites.js +++ b/lib/quintus_sprites.js @@ -678,7 +678,9 @@ Quintus.Sprites = function(Q) { this.trigger('prestep',dt); if(this.step) { this.step(dt); } this.trigger('step',dt); - Q._generateCollisionPoints(this); + if(this.p.points) { + Q._generateCollisionPoints(this); + } // Ugly coupling to stage - workaround? if(this.stage && this.children.length > 0) { From 422793e29520801bd728e92f5702b0de6a9394e6 Mon Sep 17 00:00:00 2001 From: Ben Wiley Date: Sat, 30 Jan 2016 13:39:06 -0500 Subject: [PATCH 2/6] Components can be extended now. --- lib/quintus.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/quintus.js b/lib/quintus.js index fb826523..0eebbfc8 100644 --- a/lib/quintus.js +++ b/lib/quintus.js @@ -1148,13 +1148,15 @@ var Quintus = exportTarget[key] = function(opts) { @for Quintus @method Q.component @param {String} name - component name - @param {Object} metehods - hash of methods for the component + @param {Object} methods - hash of methods for the component + @param {Component} base - base Component to extend */ - Q.component = function(name,methods) { + Q.component = function(name,methods,base) { if(!methods) { return Q.components[name]; } methods.name = name; methods.componentName = "." + name; - return (Q.components[name] = Q.Component.extend(name + "Component",methods)); + var Comp = base || Q.Component; + return (Q.components[name] = Comp.extend(name + "Component",methods)); }; From 809a7a2c3b56bd59a75fcc21d153f1da7234df25 Mon Sep 17 00:00:00 2001 From: Ben Wiley Date: Sat, 30 Jan 2016 14:26:03 -0500 Subject: [PATCH 3/6] Component base can be provided now as a string. --- lib/quintus.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/quintus.js b/lib/quintus.js index 0eebbfc8..07debadf 100644 --- a/lib/quintus.js +++ b/lib/quintus.js @@ -1148,14 +1148,19 @@ var Quintus = exportTarget[key] = function(opts) { @for Quintus @method Q.component @param {String} name - component name - @param {Object} methods - hash of methods for the component - @param {Component} base - base Component to extend + @param {Object} [methods] - hash of methods for the component + @param {Component || string} [base] - base Component to extend */ Q.component = function(name,methods,base) { if(!methods) { return Q.components[name]; } methods.name = name; methods.componentName = "." + name; - var Comp = base || Q.Component; + var Comp; + if(base) { + Comp = typeof base === 'string' ? Q.components[base] : base; + } else { + Comp = Q.Component; + } return (Q.components[name] = Comp.extend(name + "Component",methods)); }; From c487a07c82da1349208a49f529fc0ab2a67e2cd5 Mon Sep 17 00:00:00 2001 From: Ben Wiley Date: Sun, 31 Jan 2016 12:14:37 -0500 Subject: [PATCH 4/6] Using Q._isString check instead of typeof. --- lib/quintus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/quintus.js b/lib/quintus.js index 07debadf..eff76637 100644 --- a/lib/quintus.js +++ b/lib/quintus.js @@ -1157,7 +1157,7 @@ var Quintus = exportTarget[key] = function(opts) { methods.componentName = "." + name; var Comp; if(base) { - Comp = typeof base === 'string' ? Q.components[base] : base; + Comp = Q._isString(base) ? Q.components[base] : base; } else { Comp = Q.Component; } From e5ad4100114c409a34e6a1fcc30c9e136e5ffb8b Mon Sep 17 00:00:00 2001 From: Ben Wiley Date: Fri, 4 Mar 2016 00:25:46 -0500 Subject: [PATCH 5/6] Specification of loopStart and loopEnd in audio play now allowed. --- lib/quintus_audio.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/quintus_audio.js b/lib/quintus_audio.js index 817a9a0a..f1c2ac6d 100644 --- a/lib/quintus_audio.js +++ b/lib/quintus_audio.js @@ -69,6 +69,8 @@ Quintus.Audio = function(Q) { source.connect(Q.audioContext.destination); if(options && options['loop']) { source.loop = true; + source.loopStart = options['loopStart'] || 0; + source.loopEnd = options['loopEnd'] || 0; } else { setTimeout(function() { Q.audio.removeSound(soundID); From 1aa99ee21be5b337aafca8483dc75a17492973c0 Mon Sep 17 00:00:00 2001 From: Ben Wiley Date: Sat, 2 Jul 2016 23:38:01 -0400 Subject: [PATCH 6/6] File system asset loading error not thrown if running in Electron. --- lib/quintus.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/quintus.js b/lib/quintus.js index eff76637..cdbd9257 100644 --- a/lib/quintus.js +++ b/lib/quintus.js @@ -1752,11 +1752,13 @@ var Quintus = exportTarget[key] = function(opts) { fileExt = fileParts[fileParts.length-1].toLowerCase(); if(document.location.origin === "file://" || document.location.origin === "null") { - if(!Q.fileURLAlert) { - Q.fileURLAlert = true; - alert("Quintus Error: Loading assets is not supported from file:// urls - please run from a local web-server and try again"); + if (!(window && window.process && window.process.type)) { // otherwise we're probably using electron so it's OK + if(!Q.fileURLAlert) { + Q.fileURLAlert = true; + alert("Quintus Error: Loading assets is not supported from file:// urls - please run from a local web-server and try again"); + } + return errorCallback(); } - return errorCallback(); } request.onreadystatechange = function() {