1
0
Fork 0
mirror of https://gitlab.com/Oreolek/black_phone.git synced 2024-05-02 00:59:42 +03:00
Go to file
2016-01-17 13:50:25 +07:00
audio Now with MUSIC! 2016-01-04 13:55:04 +07:00
game The proper spelling is "Anastasia" 2016-01-17 13:50:25 +07:00
html Now with MUSIC! 2016-01-04 13:55:04 +07:00
img Cover image + bugfixing 2016-01-01 21:05:30 +07:00
sass Bookcase rewrite, UI fixes 2016-01-03 12:11:38 +07:00
test Did tests with lotte. Not working. 2016-01-04 22:28:40 +07:00
.gitignore Initial commit 2015-12-29 13:56:27 +07:00
.gitmodules Initial commit 2015-12-29 13:56:27 +07:00
cover.svg Cover image + bugfixing 2016-01-01 21:05:30 +07:00
Gulpfile.js Did tests with lotte. Not working. 2016-01-04 22:28:40 +07:00
LICENSE.txt Added the MIT license. 2015-12-30 19:49:38 +07:00
package.json This game does not use color functions. 2016-01-04 11:47:11 +07:00
README.md Did tests with lotte. Not working. 2016-01-04 22:28:40 +07:00

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.

Functional testing

I did functional testing using lotte and PhantomJS.

  1. Start gulp serve
  2. Install (npm install -g lotte) Lotte and PhantomJS.
  3. lotte test/test.coffee