diff --git a/README.md b/README.md index ea01e5c..0d27323 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A fan-made game inspired by Helltaker. Art by u/hohodo. -![Characters](images/characters.png) +![Characters](public/sprite/characters.webp) ## Play it diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100644 index 7e6f5eb..0000000 Binary files a/public/favicon.png and /dev/null differ diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000..70e5fb3 Binary files /dev/null and b/public/icon.png differ diff --git a/public/icon_192.png b/public/icon_192.png new file mode 100644 index 0000000..b927220 Binary files /dev/null and b/public/icon_192.png differ diff --git a/public/index.html b/public/index.html index 5da7ed3..df0b5ae 100644 --- a/public/index.html +++ b/public/index.html @@ -3,16 +3,20 @@ + - Svelte app + Heaventaker - + + + + - + diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..c68bf3c --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,29 @@ +{ + "short_name": "Heaventaker", + "name": "Heaventaker", + "icons": [ + { + "src": "/icon_192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": "/?source=pwa", + "background_color": "#333", + "display": "fullscreen", + "categories": ["games", "entertainment", "heaven"], + "scope": "/", + "theme_color": "#333", + "description": "Helltaker inspired holy game", + "orientation": "landscape", + "screenshots": [{ + "src": "/sprite/characters.png", + "sizes": "640x381", + "type": "image/png" + }] + } \ No newline at end of file diff --git a/public/service-worker.js b/public/service-worker.js new file mode 100644 index 0000000..163330c --- /dev/null +++ b/public/service-worker.js @@ -0,0 +1,40 @@ +self.addEventListener('install', function (event) { + event.waitUntil( + caches.open("main").then(function (cache) { + return cache.addAll( + [ + "/", + "/global.css", + "/times.woff2", + "/icon.png", + "/build/bundle.css", + "/build/bundle.js", + + "/sound/success.wav", + "/sound/thought_patterns.m4a", + + "/sprite/backg.webp", + "/sprite/button1.webp", + "/sprite/button2.webp", + + "/sprite/michael_happy.webp", + "/sprite/michael_normal.webp", + "/sprite/michael_wings.webp", + + "/sprite/uriel_bat.webp", + "/sprite/uriel_normal.webp", + "/sprite/uriel_side_happy.webp", + "/sprite/uriel_side_normal.webp", + ] + ); + }) + ); +}); + +self.addEventListener('fetch', function (event) { + event.respondWith( + caches.match(event.request).then(function (response) { + return response || fetch(event.request); + }) + ); +}); \ No newline at end of file diff --git a/public/sprite/backg.webp b/public/sprite/backg.webp new file mode 100644 index 0000000..9f9c739 Binary files /dev/null and b/public/sprite/backg.webp differ diff --git a/public/sprite/button.webp b/public/sprite/button.webp new file mode 100644 index 0000000..f78c927 Binary files /dev/null and b/public/sprite/button.webp differ diff --git a/public/sprite/button1.webp b/public/sprite/button1.webp new file mode 100644 index 0000000..b6ef4c7 Binary files /dev/null and b/public/sprite/button1.webp differ diff --git a/public/sprite/button2.webp b/public/sprite/button2.webp new file mode 100644 index 0000000..07bea09 Binary files /dev/null and b/public/sprite/button2.webp differ diff --git a/public/sprite/characters.webp b/public/sprite/characters.webp new file mode 100644 index 0000000..b8a7b08 Binary files /dev/null and b/public/sprite/characters.webp differ diff --git a/public/sprite/michael_happy.webp b/public/sprite/michael_happy.webp new file mode 100644 index 0000000..f11f2ff Binary files /dev/null and b/public/sprite/michael_happy.webp differ diff --git a/public/sprite/michael_normal.webp b/public/sprite/michael_normal.webp new file mode 100644 index 0000000..94ce4bb Binary files /dev/null and b/public/sprite/michael_normal.webp differ diff --git a/public/sprite/michael_wings.webp b/public/sprite/michael_wings.webp new file mode 100644 index 0000000..dace7be Binary files /dev/null and b/public/sprite/michael_wings.webp differ diff --git a/public/sprite/backg.png b/public/sprite/png/backg.png similarity index 100% rename from public/sprite/backg.png rename to public/sprite/png/backg.png diff --git a/public/sprite/button.png b/public/sprite/png/button.png similarity index 100% rename from public/sprite/button.png rename to public/sprite/png/button.png diff --git a/public/sprite/button1.png b/public/sprite/png/button1.png similarity index 100% rename from public/sprite/button1.png rename to public/sprite/png/button1.png diff --git a/public/sprite/button2.png b/public/sprite/png/button2.png similarity index 100% rename from public/sprite/button2.png rename to public/sprite/png/button2.png diff --git a/images/characters.png b/public/sprite/png/characters.png similarity index 100% rename from images/characters.png rename to public/sprite/png/characters.png diff --git a/public/sprite/michael_happy.png b/public/sprite/png/michael_happy.png similarity index 100% rename from public/sprite/michael_happy.png rename to public/sprite/png/michael_happy.png diff --git a/public/sprite/michael_normal.png b/public/sprite/png/michael_normal.png similarity index 100% rename from public/sprite/michael_normal.png rename to public/sprite/png/michael_normal.png diff --git a/public/sprite/michael_wings.png b/public/sprite/png/michael_wings.png similarity index 100% rename from public/sprite/michael_wings.png rename to public/sprite/png/michael_wings.png diff --git a/public/sprite/uriel_bat.png b/public/sprite/png/uriel_bat.png similarity index 100% rename from public/sprite/uriel_bat.png rename to public/sprite/png/uriel_bat.png diff --git a/public/sprite/uriel_normal.png b/public/sprite/png/uriel_normal.png similarity index 100% rename from public/sprite/uriel_normal.png rename to public/sprite/png/uriel_normal.png diff --git a/public/sprite/uriel_side_happy.png b/public/sprite/png/uriel_side_happy.png similarity index 100% rename from public/sprite/uriel_side_happy.png rename to public/sprite/png/uriel_side_happy.png diff --git a/public/sprite/uriel_side_normal.png b/public/sprite/png/uriel_side_normal.png similarity index 100% rename from public/sprite/uriel_side_normal.png rename to public/sprite/png/uriel_side_normal.png diff --git a/public/sprite/uriel_bat.webp b/public/sprite/uriel_bat.webp new file mode 100644 index 0000000..b67d103 Binary files /dev/null and b/public/sprite/uriel_bat.webp differ diff --git a/public/sprite/uriel_normal.webp b/public/sprite/uriel_normal.webp new file mode 100644 index 0000000..bfdea60 Binary files /dev/null and b/public/sprite/uriel_normal.webp differ diff --git a/public/sprite/uriel_side_happy.webp b/public/sprite/uriel_side_happy.webp new file mode 100644 index 0000000..d598945 Binary files /dev/null and b/public/sprite/uriel_side_happy.webp differ diff --git a/public/sprite/uriel_side_normal.webp b/public/sprite/uriel_side_normal.webp new file mode 100644 index 0000000..883650f Binary files /dev/null and b/public/sprite/uriel_side_normal.webp differ diff --git a/src/main.js b/src/main.js index 4c473fa..c5c0602 100644 --- a/src/main.js +++ b/src/main.js @@ -4,4 +4,8 @@ const app = new App({ target: document.body }); +if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('/service-worker.js'); +} + export default app; \ No newline at end of file diff --git a/src/pages/button.svelte b/src/pages/button.svelte index 13f045b..af64f4e 100644 --- a/src/pages/button.svelte +++ b/src/pages/button.svelte @@ -12,7 +12,7 @@ max-width: 700px; position: relative; font-size: 25px; - background: url("/sprite/button2.png"); + background: url("/sprite/button2.webp"); background-size: auto 100%; background-repeat: repeat-x; padding: 5px 70px; @@ -27,7 +27,7 @@ content: ""; height: 43px; width: 64px; - background: url("/sprite/button1.png"); + background: url("/sprite/button1.webp"); background-size: contain; left: -64px; top: 0; @@ -37,7 +37,7 @@ content: ""; height: 43px; width: 64px; - background: url("/sprite/button1.png"); + background: url("/sprite/button1.webp"); background-size: contain; right: -64px; top: 0; diff --git a/src/stores/characters.js b/src/stores/characters.js index b2844ac..96934bb 100644 --- a/src/stores/characters.js +++ b/src/stores/characters.js @@ -1,18 +1,18 @@ export const characters = [{ name: "Michael", - art: "/sprite/michael_normal.png", + art: "/sprite/michael_normal.webp", title: "the high marshal", poses: { - wings: "/sprite/michael_wings.png", - happy: "/sprite/michael_happy.png" + wings: "/sprite/michael_wings.webp", + happy: "/sprite/michael_happy.webp" } }, { name: "Uriel", - art: "/sprite/uriel_normal.png", + art: "/sprite/uriel_normal.webp", title: "the gate guardian", poses: { - side_normal: "/sprite/uriel_side_normal.png", - side_happy: "/sprite/uriel_side_happy.png", - bat: "/sprite/uriel_bat.png" + side_normal: "/sprite/uriel_side_normal.webp", + side_happy: "/sprite/uriel_side_happy.webp", + bat: "/sprite/uriel_bat.webp" } }]; \ No newline at end of file diff --git a/src/stores/dialog.js b/src/stores/dialog.js index 3bea893..1bde191 100644 --- a/src/stores/dialog.js +++ b/src/stores/dialog.js @@ -1,6 +1,6 @@ export const dialog = [{ name: "uriel_entrance", - background: "/sprite/backg.png", + background: "/sprite/backg.webp", character: "Uriel", pose: "side_normal", text: "Ummm... I don't want to be rude so just leave or go to the main gate.", @@ -13,27 +13,27 @@ export const dialog = [{ }] }, { name: "uriel_restart", - background: "/sprite/backg.png", + background: "/sprite/backg.webp", character: "Uriel", text: "Really dude? Well if you insist, let's start from the beggining", next: "uriel_failure" }, { name: "uriel_failure", - background: "/sprite/backg.png", + background: "/sprite/backg.webp", character: "Uriel", text: "You picked the wrong gate fool.", next: "uriel_entrance", pose: "bat" }, { name: "uriel_success", - background: "/sprite/backg.png", + background: "/sprite/backg.webp", character: "Uriel", text: "Well since it already got boring around here, and how can I say no to pancakes.", flags: ["success"], next: "michael_heretic" }, { name: "michael_heretic", - background: "/sprite/backg.png", + background: "/sprite/backg.webp", character: "Michael", text: "How did you... You know what I don't even care. Heretic like you needs to be punished.", buttons: [{ @@ -45,7 +45,7 @@ export const dialog = [{ }] }, { name: "michael_success", - background: "/sprite/backg.png", + background: "/sprite/backg.webp", character: "Michael", pose: "happy", text: "Really? Well, big man: if you survive this whole ordeal, prepare a room and we shall see how into this shit you really are", @@ -53,7 +53,7 @@ export const dialog = [{ next: "uriel_entrance" }, { name: "michael_failure", - background: "/sprite/backg.png", + background: "/sprite/backg.webp", character: "Michael", text: "I also have something to offer: eat shit and die.", pose: "wings",