diff --git a/images/xcf/button2.xcf b/images/xcf/button2.xcf index 61ff070..40442b8 100644 Binary files a/images/xcf/button2.xcf and b/images/xcf/button2.xcf differ diff --git a/images/button1.png b/public/sprite/button1.png similarity index 100% rename from images/button1.png rename to public/sprite/button1.png diff --git a/images/button2.png b/public/sprite/button2.png similarity index 59% rename from images/button2.png rename to public/sprite/button2.png index c38c081..86b59f7 100644 Binary files a/images/button2.png and b/public/sprite/button2.png differ diff --git a/src/App.svelte b/src/App.svelte index 2215d32..e78098b 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -8,16 +8,17 @@ var page = "game"; var current = localStorage.getItem("dialog-page") || 0; - var preloads = []; + var preloads = new Map; + function preload(url) { + if(preloads.has(url)) return; + preloads.set(url, new Image); + preloads.get(url).src = url; + } for(let character of characters) { - var img = new Image(); - img.src = character.art; // preload art - preloads.push(img); + preload(character.art); // preload art } for(let d of dialog) { - var img = new Image(); - img.src = d.background; // preload art - preloads.push(img); + preload(d.background); // preload art } var music = new Howl({ diff --git a/src/pages/button.svelte b/src/pages/button.svelte index fa5eb4f..13f045b 100644 --- a/src/pages/button.svelte +++ b/src/pages/button.svelte @@ -9,22 +9,41 @@ \ No newline at end of file diff --git a/src/pages/dialog.svelte b/src/pages/dialog.svelte index 6711835..8a91b29 100644 --- a/src/pages/dialog.svelte +++ b/src/pages/dialog.svelte @@ -86,8 +86,10 @@
-

{character.name}, {character.title}

-

{d.text}

+
+

{character.name}, {character.title}

+

{d.text}

+
{#if d.buttons} {#each d.buttons as button, i} @@ -198,13 +200,17 @@ } } .text { - max-width: 700px; + max-width: 900px; margin: 0 auto; } + .data { + margin: 0 auto; + max-width: 700px; + } .background { position: relative; - height: 70%; - width: 100%; + height: 70vh; + width: 100vw; overflow: hidden; } .background img { diff --git a/src/pages/overlay.svelte b/src/pages/overlay.svelte index 21e3e18..20f703e 100644 --- a/src/pages/overlay.svelte +++ b/src/pages/overlay.svelte @@ -24,6 +24,7 @@ width: 100vw; height: 100vh; transition: top .2s; + overflow: auto; } .main.active { height: 100%; diff --git a/src/stores/characters.js b/src/stores/characters.js index 610d3cb..b2844ac 100644 --- a/src/stores/characters.js +++ b/src/stores/characters.js @@ -6,4 +6,13 @@ export const characters = [{ wings: "/sprite/michael_wings.png", happy: "/sprite/michael_happy.png" } +}, { + name: "Uriel", + art: "/sprite/uriel_normal.png", + title: "the gate guardian", + poses: { + side_normal: "/sprite/uriel_side_normal.png", + side_happy: "/sprite/uriel_side_happy.png", + bat: "/sprite/uriel_bat.png" + } }]; \ No newline at end of file diff --git a/src/stores/dialog.js b/src/stores/dialog.js index 8c38a01..3bea893 100644 --- a/src/stores/dialog.js +++ b/src/stores/dialog.js @@ -1,4 +1,37 @@ export const dialog = [{ + name: "uriel_entrance", + background: "/sprite/backg.png", + character: "Uriel", + pose: "side_normal", + text: "Ummm... I don't want to be rude so just leave or go to the main gate.", + buttons: [{ + text: "Step aside, I got heaven to conquer and angels to take.", + next: "uriel_restart" + }, { + text: "Would you like to join my harem? We got puppies and pancakes.", + next: "uriel_success" + }] +}, { + name: "uriel_restart", + background: "/sprite/backg.png", + 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", + character: "Uriel", + text: "You picked the wrong gate fool.", + next: "uriel_entrance", + pose: "bat" +}, { + name: "uriel_success", + background: "/sprite/backg.png", + 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", character: "Michael", @@ -17,7 +50,7 @@ export const dialog = [{ 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", flags: ["success"], - next: "michael_heretic" + next: "uriel_entrance" }, { name: "michael_failure", background: "/sprite/backg.png",