diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b82b2c1 Binary files /dev/null and b/.DS_Store differ diff --git a/Platformer template/.DS_Store b/Platformer template/.DS_Store new file mode 100644 index 0000000..b1818b9 Binary files /dev/null and b/Platformer template/.DS_Store differ diff --git a/Platformer template/Template.c3p b/Platformer template/Template.c3p new file mode 100644 index 0000000..e739039 Binary files /dev/null and b/Platformer template/Template.c3p differ diff --git a/Platformer template/appmanifest.json b/Platformer template/appmanifest.json new file mode 100755 index 0000000..863720d --- /dev/null +++ b/Platformer template/appmanifest.json @@ -0,0 +1,36 @@ +{ + "name": "Platformer template", + "short_name": "Platformer template", + "description": "", + "start_url": "index.html", + "display": "fullscreen", + "orientation": "any", + "background_color": "#ffffff", + "icons": [ + { + "src": "icons/icon-16.png", + "sizes": "16x16", + "type": "image/png" + }, + { + "src": "icons/icon-32.png", + "sizes": "32x32", + "type": "image/png" + }, + { + "src": "icons/icon-114.png", + "sizes": "114x114", + "type": "image/png" + }, + { + "src": "icons/icon-128.png", + "sizes": "128x128", + "type": "image/png" + }, + { + "src": "icons/icon-256.png", + "sizes": "256x256", + "type": "image/png" + } + ] +} \ No newline at end of file diff --git a/Platformer template/data.json b/Platformer template/data.json new file mode 100755 index 0000000..d9142ec --- /dev/null +++ b/Platformer template/data.json @@ -0,0 +1 @@ +{"project":["Platformer template",null,[[0,false,true,true,true,true,true,true,true,true],[1,false,true,true,true,true,true,true,true,false],[7,true,false,false,false,false,false,false,false,false],[8,false,true,true,true,true,true,true,true,false]],[["BackgroundTile",0,false,[],0,0,["images/backgroundtile-sheet0.png",125,0,0,0,32,32],null,[],false,false,689896111384873,[],null],["Player",1,false,[],2,0,null,[["Default",5,false,1,0,false,734810610482486,[["images/shared-0-sheet0.png",209,0,0,32,32,1,0.5,1,[],[],0]]]],[["Platform",2,102058207846856],["ScrollTo",3,280961176510301]],false,false,826610325620297,[],null],["SolidTile",0,false,[],1,0,["images/solidtile-sheet0.png",123,0,0,0,32,32],null,[["Solid",4,605929759072641]],false,false,463285828161762,[],null],["MovingSolidTile",0,false,[],2,0,["images/solidtile-sheet0.png",123,0,0,0,32,32],null,[["Solid",4,475853687276520],["Sine",5,406072062097919]],false,false,885053456940033,[],null],["JumpThruTile",0,false,[],1,0,["images/jumpthrutile-sheet0.png",120,0,0,0,32,32],null,[["Jumpthru",6,609014660854342]],false,false,515236225826519,[],null],["Keyboard",7,false,[],0,0,null,null,[],false,false,372854524738558,[],null,[]],["Text",8,false,[],0,0,null,null,[],false,false,395520036116606,[],null]],[],[["Layout 1",1280,1024,false,"Event sheet 1",195586522291231,[["Background",0,835917738008775,true,[255,255,255],false,0.5,0.5,1,false,false,1,0,0,[[[0,0,0,1280,1024,0,0,[1,1,1,1],0,0,0,0,[]],0,0,[],[],[true,0,0,0,1,1,0]]],[]],["Game",1,628603958392595,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[164,756,0,104,104,0,0,[1,1,1,1],0.5,1,0,0,[]],1,1,[],[[330,1500,1500,650,1500,1000,false,0,true,true],[true]],[true,"Default",0,true]],[[64,768,0,320,128,0,0,[1,1,1,1],0,0,0,0,[]],2,2,[],[[true,""]],[true,0,0,0,1,1,0]],[[864,800,0,96,32,0,0,[1,1,1,1],0,0,0,0,[]],2,3,[],[[true,""]],[true,0,0,0,1,1,0]],[[1088,736,0,96,32,0,0,[1,1,1,1],0,0,0,0,[]],2,4,[],[[true,""]],[true,0,0,0,1,1,0]],[[992,928,0,128,32,0,0,[1,1,1,1],0,0,0,0,[]],2,5,[],[[true,""]],[true,0,0,0,1,1,0]],[[544,800,0,128,32,0,0,[1,1,1,1],0,0,0,0,[]],3,6,[],[[true,""],[0,0,4,0,0,0,50,0,true]],[true,0,0,0,1,1,0]],[[1056,624,0,160,16,0,0,[1,1,1,0.800000012],0,0,0,0,[]],4,7,[],[[true]],[true,0,0,0,1,1,0]],[[1056,528,0,160,16,0,0,[1,1,1,0.800000012],0,0,0,0,[]],4,8,[],[[true]],[true,0,0,0,1,1,0]],[[624.159057617,432.067077637,0,372.034545898,32,0,0.17453292,[1,1,1,1],0,0,0,0,[]],2,9,[],[[true,""]],[true,0,0,0,1,1,0]],[[528,432,0,96,32,0,0,[1,1,1,1],0,0,0,0,[]],2,10,[],[[true,""]],[true,0,0,0,1,1,0]],[[346,339,0,219,32,0,0.453596234,[1,1,1,1],0,0,0,0,[]],2,11,[],[[true,""]],[true,0,0,0,1,1,0]],[[160,224,0,96,16,0,0,[1,1,1,0.800000012],0,0,0,0,[]],4,12,[],[[true]],[true,0,0,0,1,1,0]],[[160,336,0,96,32,0,0,[1,1,1,1],0,0,0,0,[]],2,13,[],[[true,""]],[true,0,0,0,1,1,0]],[[320,160,0,96,16,0,0,[1,1,1,0.800000012],0,0,0,0,[]],4,14,[],[[true]],[true,0,0,0,1,1,0]],[[512,128,0,96,16,0,0,[1,1,1,0.800000012],0,0,0,0,[]],4,15,[],[[true]],[true,0,0,0,1,1,0]],[[752,160,0,128,32,0,0,[1,1,1,1],0,0,0,0,[]],3,16,[],[[true,""],[0,0,4,0,0,0,50,0,true]],[true,0,0,0,1,1,0]],[[1056,192,0,96,16,0,0,[1,1,1,0.800000012],0,0,0,0,[]],4,17,[],[[true]],[true,0,0,0,1,1,0]],[[928,288,0,96,16,0,0,[1,1,1,1],0,0,0,0,[]],3,18,[],[[true,""],[1,0,4,0,0,0,50,0,true]],[true,0,0,0,1,1,0]],[[65,900,0,352,32,0,0,[1,1,1,1],0,0,0,0,[]],6,19,[],[],["Arrow keys or WASD to move",false,"Arial",12,0,false,false,[0,0,0],0,0,0,true,0]]],[]]],[],[]]],[["Event sheet 1",[[0,null,false,null,128459781631962,[[5,9,null,1,false,false,false,305389046261418,null,[[9,40]]]],[[1,10,"Platform",892367029867673,null]]],[0,null,false,null,645292426100724,[[5,11,null,0,false,false,false,632243729452326,null,[[9,87]]]],[[1,12,"Platform",920742090584576,null,[[3,2]]]]],[0,null,false,null,242167283932481,[[5,11,null,0,false,false,false,483950024948899,null,[[9,65]]]],[[1,12,"Platform",775074611847897,null,[[3,0]]]]],[0,null,false,null,539757104898646,[[5,11,null,0,false,false,false,606056445084855,null,[[9,83]]]],[[1,10,"Platform",704843732518047,null]]],[0,null,false,null,591315574743711,[[5,11,null,0,false,false,false,248839217420683,null,[[9,68]]]],[[1,12,"Platform",700473221744042,null,[[3,1]]]]],[0,null,true,null,636041846004128,[[5,9,null,1,false,false,false,528722391729597,null,[[9,37]]],[5,9,null,1,false,false,false,146542714002785,null,[[9,65]]]],[[1,13,null,132393308998210,null,[[3,0]]]]],[0,null,true,null,141520300585655,[[5,9,null,1,false,false,false,711168855441086,null,[[9,39]]],[5,9,null,1,false,false,false,981994648819837,null,[[9,68]]]],[[1,13,null,834972848466442,null,[[3,1]]]]],[0,null,false,null,301769199928821,[[1,14,null,0,false,false,false,564820914778219,null,[[8,4],[0,[0,[4,15]]]]]],[[-1,16,null,541417716131689,null]]]]]],[],"media/",false,640,480,4,true,true,true,"1.0",true,false,4,0,22,false,true,1,true,false,[],"icons/",[],true,"jmuqhzg0uup","fonts/",[],"high-performance"]} \ No newline at end of file diff --git a/Platformer template/icons/icon-114.png b/Platformer template/icons/icon-114.png new file mode 100755 index 0000000..42b1a39 Binary files /dev/null and b/Platformer template/icons/icon-114.png differ diff --git a/Platformer template/icons/icon-128.png b/Platformer template/icons/icon-128.png new file mode 100755 index 0000000..e782d90 Binary files /dev/null and b/Platformer template/icons/icon-128.png differ diff --git a/Platformer template/icons/icon-16.png b/Platformer template/icons/icon-16.png new file mode 100755 index 0000000..47d4f73 Binary files /dev/null and b/Platformer template/icons/icon-16.png differ diff --git a/Platformer template/icons/icon-256.png b/Platformer template/icons/icon-256.png new file mode 100755 index 0000000..fe22ecc Binary files /dev/null and b/Platformer template/icons/icon-256.png differ diff --git a/Platformer template/icons/icon-32.png b/Platformer template/icons/icon-32.png new file mode 100755 index 0000000..4300c36 Binary files /dev/null and b/Platformer template/icons/icon-32.png differ diff --git a/Platformer template/icons/loading-logo.png b/Platformer template/icons/loading-logo.png new file mode 100755 index 0000000..434c22e Binary files /dev/null and b/Platformer template/icons/loading-logo.png differ diff --git a/Platformer template/images/backgroundtile-sheet0.png b/Platformer template/images/backgroundtile-sheet0.png new file mode 100755 index 0000000..081b1e0 Binary files /dev/null and b/Platformer template/images/backgroundtile-sheet0.png differ diff --git a/Platformer template/images/jumpthrutile-sheet0.png b/Platformer template/images/jumpthrutile-sheet0.png new file mode 100755 index 0000000..13d7586 Binary files /dev/null and b/Platformer template/images/jumpthrutile-sheet0.png differ diff --git a/Platformer template/images/shared-0-sheet0.png b/Platformer template/images/shared-0-sheet0.png new file mode 100755 index 0000000..e0371fc Binary files /dev/null and b/Platformer template/images/shared-0-sheet0.png differ diff --git a/Platformer template/images/solidtile-sheet0.png b/Platformer template/images/solidtile-sheet0.png new file mode 100755 index 0000000..ecde66a Binary files /dev/null and b/Platformer template/images/solidtile-sheet0.png differ diff --git a/Platformer template/index.html b/Platformer template/index.html new file mode 100755 index 0000000..33dfc23 --- /dev/null +++ b/Platformer template/index.html @@ -0,0 +1,31 @@ + + +
+ +o+p)||(c=this._blx-this._tlx,d=this._bly-this._tly,i=c*c+d*d,j=c*e+d*f,k=c*g+d*h,n=1/(i*l-j*j),o=(l*k-j*m)*n,p=(i*m-j*k)*n,0<=o&&0
o+p)}midX(){return(this._tlx+this._trx+this._brx+this._blx)/4}midY(){return(this._tly+this._try+this._bry+this._bly)/4}intersectsSegment(a,b,c,d){return!!(this.containsPoint(a,b)||this.containsPoint(c,d))||C3.segmentIntersectsQuad(a,b,c,d,this)}intersectsQuad(a){let b=a.midX(),c=a.midY();if(this.containsPoint(b,c))return!0;if(b=this.midX(),c=this.midY(),a.containsPoint(b,c))return!0;const d=this._tlx,e=this._tly,f=this._trx,g=this._try,h=this._brx,i=this._bry,j=this._blx,k=this._bly;return C3.segmentIntersectsQuad(d,e,f,g,a)||C3.segmentIntersectsQuad(f,g,h,i,a)||C3.segmentIntersectsQuad(h,i,j,k,a)||C3.segmentIntersectsQuad(j,k,d,e,a)}mirror(){this._swap(0,2),this._swap(1,3),this._swap(6,4),this._swap(7,5)}flip(){this._swap(0,6),this._swap(1,7),this._swap(2,4),this._swap(3,5)}diag(){this._swap(2,6),this._swap(3,7)}_swap(a,b){const c=this._getAtIndex(a);this._setAtIndex(a,this._getAtIndex(b)),this._setAtIndex(b,c)}_getAtIndex(a){switch(a){case 0:return this._tlx;case 1:return this._tly;case 2:return this._trx;case 3:return this._try;case 4:return this._brx;case 5:return this._bry;case 6:return this._blx;case 7:return this._bly;default:throw new RangeError("invalid quad point index");}}_setAtIndex(a,b){switch(b=+b,a){case 0:this._tlx=b;break;case 1:this._tly=b;break;case 2:this._trx=b;break;case 3:this._try=b;break;case 4:this._brx=b;break;case 5:this._bry=b;break;case 6:this._blx=b;break;case 7:this._bly=b;break;default:throw new RangeError("invalid quad point index");}}}}
+
+// c3/lib/misc/collisionPoly.js
+"use strict";{const a=[0,0,1,0,1,1,0,1],b=C3.New(C3.Quad);C3.CollisionPoly=class extends C3.DefendedBase{constructor(b){super(),b||(b=a);this._ptsArr=Float64Array.from(b),this._bbox=new C3.Rect,this._isBboxChanged=!0}Release(){}pointsArr(){return this._ptsArr}pointCount(){return this._ptsArr.length/2}setPoints(a){this._ptsArr.length===a.length?this._ptsArr.set(a):this._ptsArr=Float64Array.from(a),this._isBboxChanged=!0}copy(a){this.setPoints(a._ptsArr)}setBboxChanged(){this._isBboxChanged=!0}_updateBbox(){if(!this._isBboxChanged)return;const a=this._ptsArr;let b=a[0],c=a[1],d=b,e=c;for(let f=0,g=a.length;f
On Android, make sure the Android System Webview and Chrome apps have updates enabled and are up-to-date.":/iphone|ipad|ipod/i.test(h)&&(g+="
Note: the iOS simulator is not currently supported due to an Apple bug. If you are using the simulator, try testing on a real device instead."),g+="
Missing features: "+c.join(", ")+"",f.innerHTML=g,d.appendChild(f)}})();
\ No newline at end of file
diff --git a/Platformer template/style.css b/Platformer template/style.css
new file mode 100755
index 0000000..4fd3df5
--- /dev/null
+++ b/Platformer template/style.css
@@ -0,0 +1,34 @@
+html, body {
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+
+ background: #000000;
+ color: white;
+}
+
+html, body, canvas {
+ touch-action: none;
+ touch-action-delay: none;
+}
+
+#notSupportedWrap {
+ margin: 2em auto 1em auto;
+ width: 75%;
+ max-width: 45em;
+ border: 2px solid #aaa;
+ border-radius: 1em;
+ padding: 2em;
+ background-color: #f0f0f0;
+ font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
+ color: black;
+}
+
+#notSupportedTitle {
+ font-size: 1.8em;
+}
+
+#notSupportedMessage {
+ font-size: 1.2em;
+}
+
diff --git a/Platformer template/sw.js b/Platformer template/sw.js
new file mode 100755
index 0000000..4366997
--- /dev/null
+++ b/Platformer template/sw.js
@@ -0,0 +1 @@
+"use strict";const OFFLINE_DATA_FILE="offline.json",CACHE_NAME_PREFIX="c3offline",BROADCASTCHANNEL_NAME="offline",CONSOLE_PREFIX="[SW] ",LAZYLOAD_KEYNAME="",broadcastChannel="undefined"==typeof BroadcastChannel?null:new BroadcastChannel("offline");function PostBroadcastMessage(a){broadcastChannel&&setTimeout(()=>broadcastChannel.postMessage(a),3e3)}function Broadcast(a){PostBroadcastMessage({"type":a})}function BroadcastDownloadingUpdate(a){PostBroadcastMessage({"type":"downloading-update","version":a})}function BroadcastUpdateReady(a){PostBroadcastMessage({"type":"update-ready","version":a})}function IsUrlInLazyLoadList(a,b){if(!b)return!1;try{for(const c of b)if(new RegExp(c).test(a))return!0}catch(a){console.error("[SW] Error matching in lazy-load list: ",a)}return!1}function WriteLazyLoadListToStorage(a){return"undefined"==typeof localforage?Promise.resolve():localforage.setItem(LAZYLOAD_KEYNAME,a)}function ReadLazyLoadListFromStorage(){return"undefined"==typeof localforage?Promise.resolve([]):localforage.getItem(LAZYLOAD_KEYNAME)}function GetCacheBaseName(){return"c3offline-"+self.registration.scope}function GetCacheVersionName(a){return GetCacheBaseName()+"-v"+a}async function GetAvailableCacheNames(){const a=await caches.keys(),b=GetCacheBaseName();return a.filter((a)=>a.startsWith(b))}async function IsUpdatePending(){const a=await GetAvailableCacheNames();return 2<=a.length}async function GetMainPageUrl(){const a=await clients.matchAll({includeUncontrolled:!0,type:"window"});for(const b of a){let a=b.url;if(a.startsWith(self.registration.scope)&&(a=a.substring(self.registration.scope.length)),a&&"/"!==a)return a.startsWith("?")&&(a="/"+a),a}return""}function fetchWithBypass(a,b){return"string"==typeof a&&(a=new Request(a)),b?fetch(a.url,{headers:a.headers,mode:a.mode,credentials:a.credentials,redirect:a.redirect,cache:"no-store"}):fetch(a)}async function CreateCacheFromFileList(a,b,c){const d=await Promise.all(b.map((a)=>fetchWithBypass(a,c)));let e=!0;for(const f of d)f.ok||(e=!1,console.error("[SW] Error fetching '"+f.url+"' ("+f.status+" "+f.statusText+")"));if(!e)throw new Error("not all resources were fetched successfully");const f=await caches.open(a);try{return await Promise.all(d.map((a,c)=>f.put(b[c],a)))}catch(b){throw console.error("[SW] Error writing cache entries: ",b),caches.delete(a),b}}async function UpdateCheck(a){try{const b=await fetchWithBypass(OFFLINE_DATA_FILE,!0);if(!b.ok)throw new Error("offline.json responded with "+b.status+" "+b.statusText);const c=await b.json(),d=c.version,e=c.fileList,f=c.lazyLoad,g=GetCacheVersionName(d),h=await caches.has(g);if(h){const a=await IsUpdatePending();return void(a?(console.log("[SW] Update pending"),Broadcast("update-pending")):(console.log("[SW] Up to date"),Broadcast("up-to-date")))}const i=await GetMainPageUrl();e.unshift("./"),i&&-1===e.indexOf(i)&&e.unshift(i),console.log("[SW] Caching "+e.length+" files for offline use"),a?Broadcast("downloading"):BroadcastDownloadingUpdate(d),f&&(await WriteLazyLoadListToStorage(f)),await CreateCacheFromFileList(g,e,!a);const j=await IsUpdatePending();j?(console.log("[SW] All resources saved, update ready"),BroadcastUpdateReady(d)):(console.log("[SW] All resources saved, offline support ready"),Broadcast("offline-ready"))}catch(a){console.warn("[SW] Update check failed: ",a)}}self.addEventListener("install",(a)=>{a.waitUntil(UpdateCheck(!0).catch(()=>null))});async function GetCacheNameToUse(a,b){if(1===a.length||!b)return a[0];const c=await clients.matchAll();if(1