Skip to content

Commit 2b6b3d1

Browse files
Merge pull request #13 from roman-yagodin/master
Update website
2 parents 58b13ae + d37e8d7 commit 2b6b3d1

File tree

5 files changed

+60
-10
lines changed

5 files changed

+60
-10
lines changed

Diff for: data/carroll/f3acae8e.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: Lewis Carroll
3-
colors: [ yellow, orange, red ]
3+
colors: [ white, yellow, orange, red ]
44
hints:
55
- How are you doing?
66
---

Diff for: data/etc/72e07e3d.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
author: Rumi
3+
colors: [red]
4+
link: https://crawl.develz.org/
5+
---
6+
If all you can do is crawl, start crawling.

Diff for: index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<html>
33
<head>
4-
<title>5D action adventure</title>
4+
<title>Protogame: 5D action adventure</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
66
<link rel="stylesheet" href="css/xterm.css" />
77
<link rel="stylesheet" href="css/styles.css" />

Diff for: js/app.js

+51-7
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { DEBUG } from "./debug.js";
66
const EOL = "\n\r";
77

88
// type interval
9-
const _1t = 16;
9+
const _1t = 15;
1010

1111
// wait intervals
12-
const _1s = 1000;
12+
const _1s = 1024;
1313
const _hs = _1s / 2;
1414
const _2s = _1s * 2;
1515
const _3s = _1s * 3;
@@ -150,8 +150,13 @@ async function typeln(s, typeDelay) {
150150
}
151151
}
152152

153-
async function type(s, typeDelay = _1t) {
153+
async function type(s, typeDelay = -1) {
154154

155+
// longer type delay for longer strings
156+
if (typeDelay < 0) {
157+
typeDelay = s.length * 0.025 + _1t;
158+
}
159+
155160
s = s.replace("\\b", "\b");
156161

157162
// bold
@@ -331,12 +336,12 @@ async function puzzle1() {
331336
await typeln();
332337

333338
const optionSomething = {
334-
text: `I ${randomMsg(["feel", "*feel*", "_feel_"])} ${randomMsg(["something", "*something*", "_something_"])}!`,
339+
text: `I feel ${randomMsg(["something", "*something*", "_something_"])}!`,
335340
choice: "something"
336341
};
337342

338343
const optionAnything = {
339-
text: `I do ${randomMsg(["feel", "*feel*", "_feel_"])} ${randomMsg(["anything", "*anything*", "anything"])}.`,
344+
text: `I do feel ${randomMsg(["anything", "*anything*", "anything"])}.`,
340345
choice: "anything"
341346
};
342347

@@ -581,16 +586,26 @@ async function scene4_world(note) {
581586
}
582587

583588
// TODO: Positive/negative switch: "Don't follow"
584-
const choice = await menu([
589+
let choices = [
585590
{ text: "", choice: "showMenu" },
586591
{ text: "Follow author.", choice: "followAuthor" },
587592
{ text: "Follow color.", choice: "followColor" },
588593
{ text: "Follow language.", choice: "followLanguage" },
589594
// TODO: Move utilities to submenu or review mode?
590595
{ text: "Request hint.", choice: "hint" },
591596
{ text: "Copy the note.", choice: "copy" },
597+
{ text: "Repeat.", choice: "repeat" },
592598
{ text: "Leave...", choice: "leave" },
593-
], showMenu);
599+
];
600+
601+
if (note.id.includes("-")) {
602+
choices = choices.toSpliced(4, 0, {
603+
text: "In English, please!",
604+
choice: "inEnglish"
605+
});
606+
}
607+
608+
const choice = await menu(choices, showMenu);
594609
showMenu = false;
595610

596611
game.decrementActionCounter();
@@ -606,6 +621,12 @@ async function scene4_world(note) {
606621
showMenu = true;
607622
}
608623

624+
if (choice === "repeat") {
625+
await typeln();
626+
showNote = true;
627+
showMenu = true;
628+
}
629+
609630
if (choice === "followAuthor") {
610631
const nextNote = game.notes.find(n => {
611632
if (n.meta.author == note.meta.author && !game.state.breadCrumbs.includes(n.id)) {
@@ -669,6 +690,29 @@ async function scene4_world(note) {
669690
showNote = true;
670691
showMenu = true;
671692
}
693+
694+
if (choice === "inEnglish") {
695+
const baseId = note.id.replace(/-.*/g, "");
696+
const nextNote = game.notes.find(n => {
697+
// count breadcrumbs or not?
698+
if (n.id === baseId) {
699+
return true;
700+
}
701+
return false;
702+
});
703+
704+
if (nextNote) {
705+
note = nextNote;
706+
game.state.breadCrumbs.push(note.id);
707+
game.saveState();
708+
}
709+
else {
710+
await reachedEOW();
711+
noteColor = randomNoteColor(note);
712+
}
713+
showNote = true;
714+
showMenu = true;
715+
}
672716

673717
if (choice === "copy") {
674718
const wasCopied = await copyToClipboard(note.original);

Diff for: js/data.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)