Skip to content

Instantly share code, notes, and snippets.

@JoshuaGrams
JoshuaGrams / reveal.tw
Last active February 4, 2026 05:47
Line-by-line text reveal: Twine/SugarCube.
:: Some Passage
This will show at the start.
@@.hide;This will show after you click or press space/enter.@@
@@.hide;.nocontinue;This will show after you advance again, but will <em>not</em> have the continue marker.@@
<span class="hide">HTML tags work fine too, but the other notation is shorter.</span>
@xem
xem / JSGameFramework2020.html
Last active July 1, 2025 19:44
JS game framework 2020
<body style=margin:0>
<canvas id=a>
<script>
// initialize 2D canvas (c)
// initialize game state (s)
// initialize keys states (u,r,d,l for directions, k for all the keyboard)
c=a.getContext`2d`,k=[u=r=d=l=s=0]
// (initialize your global variables here)
@cyrusfirheir
cyrusfirheir / VN-style-dialogue-system(SugarCube-v2)-part1.md
Last active June 16, 2025 09:39
Storing dialogue in plain text and converting it to html elements on the fly using JavaScript.

Storing dialogue in plain text and converting it to html elements on the fly using JavaScript. (Part 1)

Note!
This system is not a replacement for standard usage, and has been developed only to facilitate faster/easier markup of story/dialogue data. In no way is this advanced enough to handle choices and a bajillion conditionals. At least not yet.

This sort of an approach is best suited when one needs to display text sequentially (like in a Visual Novel) without focusing much on writing html or macros. I decided to do something like this because typing:

<<speech "Speaker Name">>
	Speech text