Skip to content

anko/Bohr-Automaton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bohr automaton

(GDSE Anniversary Game Jam 2014 submission from Anko; written in 3 days)

Theme-words: Heights, Automation, Destroy

screenshot

(Tested in Chrome/Chromium. Others may have rendering bugs.)

It's a web-based puzzle game; inspired by Niels Bohr's electron energy level theory.

How to play

Aim: Destroy red anti-electrons around your atom, by touching them with electrons.

Controls: Arrange the green electrons with drag-and-drop, then click the nucleus (center circle) to set them off moving automatically. Click on the nucleus again to reset. To skip between levels, click the little level indicators around the nucleus.

Rules: (The levels are tutorial-like, so maybe just play it.) Electrons move clockwise along their orbits. Each has a "spin" (direction indicated by icon), which determines whether it stays at the same orbit height (square), rises by one every step (up arrow) or drops by one every step (down arrow). Electrons disappear if they go above the highest orbit or lower than the lowest. When an electron destroys an anti-electron, it absorbs its spin and starts moving in that way.

Tech overview

Written in LiveScript in a functional programming style. SVG-rendered with the D3.js data-vis library. Sound effects from Bfxr, ending jingle rendered in SunVox, played in the browser (optionally) through WebAudio.

The client.ls-file contains all the interesting parts. I tried to keep it legible and commented, but there's only so much you can do in a weekend. :)

Compiling/Running

Just npm install in the root directory.

You'll need Node.js and basic UNIX utilities (make and cp). The game will build itself into static/, where you can then run a webserver (e.g. [with Python][16]), then open the game in a browser—preferably Chrome or Chromium (mobile is good too).

I haven't tried building it on Windows, but the makefile should give you an idea of how to piece together the commands you need to build it yourself. Email me if you get stuck.

If you're on a UNIX-like with inotify-support in your kernel (newest Linuxes do), then make watch is a handy helper: It waits for changes to the LiveScript code and recompiles it to JavaScript automatically whenever the file changes.

License is [ISC][17].

[16]: http://stackoverflow.com/questions/7943751/what-is-the-python3-equivalent-of-python-m-simplehttpserver) [17]: http://en.wikipedia.org/wiki/ISC_license

About

Web-based puzzle game in LiveScript and D3.js (for GDSE Anniversary Game Jam 2014)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published