game | ||
html | ||
img | ||
sass | ||
.gitignore | ||
.gitmodules | ||
cover.svg | ||
Gulpfile.js | ||
LICENSE.txt | ||
package.json | ||
README.md |
The Black Phone
A walk through someone else's apartment
Provided under the terms of MIT license, see LICENSE.txt
Hacks and whistles
"Black phone" boasts a new technical feature: additional room exits.
This is something I greatly missed coming from INSTEAD.
I had to hack Undum and expose ("export") its processClick
function so I could make an additional interface block.
The technical side is simple: my Undum-commonjs fork exports processClick
function.
Every situation that is a room (there are non-room situations, mind) has an array of ways
.
This array has every other room this one connects to.
On entering a room, the before
function calls for update_ways
function that reads ways
array and updates the UI.
It's not automatic but the game is small enough for this to work.
Undum has a bug: every "once" link becomes clickable again when you visit the same situation. For example, you can save the game, load it again and click everything the second time.
The game exploits this because you can visit any room again and examine everything you missed.
There is also a slightly debatable UI hack: as every link is "once" link (it gets deactivated once it's called), I've sped up every click by 250ms or so like this:
document.onmousedown = (e) ->
e.target.click()
A "click" in Javascript is an event of clicking the mouse button and releasing it. The "mousedown" event is just clicking the button, not waiting for the release. I didn't bother with intricacies, so the right mouse click is treated the same as the left one.
Known bugs
- The
once
bug I mentioned earlier (it's almost a feature by now) - The
writemd
function just pops the text out. This is inconsistent with normal actions and situation transitions that play a slideDown animation for that.