One of my favourite games to come out of the 2014 Global Game Jam was Beholder High,
a web-based dating sim set in a high school for beholders.
As the description says:
High school is a confusing time. Especially for beholders. Now the Big Dance is right around the
corner, and you don’t have a date! Choose a fellow beholder student and woo them before it’s too
late, or the consequences could be dire!
Unfortunately time has passed and you can’t play the game online anymore:
Fortunately, I was talking to a couple of the folks who made the game, and pitched the idea of
resurrecting it as an SMS game. They were nice enough to say it was ok, so that’s what I’ll do.
First Things First
To have something to compare against, I needed to get the original up and running first. It was in
PHP, so I set up a nice LAMP server
and threw the source on it.
Ah, but it’s looking for http://<hostname>/InTheHighOfTheBeholder/css/style.css, so I just move
everything under an InTheHighOfTheBeholder directory, and…
Yay! Part of the problem trying to deploy anyone else’s code is figuring out the setup. Now we have
a working instance of the original game to compare against and experiment with.
There are a lot of PHP files; one for each possible state in the game. Awkward, but that’s not
unusual for Jam games. Now before I write some code to parse through all of these, let’s see if
the developer ever went back to refactor the code…
{"SPLASH":{"bg":"Splash","textEntry":{"key":"playerName","next":"DAY1","buttonText":"Start"},"audio":"Looping"},"DAY1":{"bg":"Day1","next":"D1S100","buttonText":"Next"},"D1S100":{"bg":"Classroom","story":"We don't have long.","next":"D1S101","buttonText":"Next"},"D1S101":{
A nice big JSON file with all of the narrative logic. Consuming that will be a lot easier than
parsing a bunch of PHP files.
Let’s get started
Since we’re not doing a Jam, let’s put together a somewhat proper TDD environment. To get started
with RSpec on Sinatra, I found
GetLaura: How to Test a Sinatra app with RSpec
to be a good refresher.
A little CI goodness and we’re ready to get started!
it'responds with initial state'doget'/',From:'Dude1'expect(last_response.body).toinclude('Please tell me your name.')endit'responds with initial state for each player'doget'/',From:'Dude1'get'/',From:'Dude2'expect(last_response.body).toinclude('Please tell me your name.')endit'moves to second state'doget'/',From:'Dude3'get'/',From:'Dude3'expect(last_response.body).toinclude('Day One.')end