The JavaScript blog.


games education ES6


Posted on .

WarriorJS (GitHub: olistic/warriorjs, License: MIT, npm: warriorjs) by Matías Olivera is a game that you play by writing ES6 code. Each level is solved by moving the player and interacting with units which include archers and wizards. The simplest level is best by moving the player left, so you just edit Player.js to include the line warrior.walk() in the right place.


The warrior actually has hit points, and there are two difficulty levels: beginner and intermediate. The levels are JSON files, so you could make your own fairly easily.

Matías will be adding new levels over time, so to check if there are new ones run npm outdated -g warriorjs.


tools games education

TRY.js, MightyEditor

Posted on .


When I was at school we had a turtle graphics game that was meant to teach the rudiments of programming. It also had a turtle robot that you could drive around. There are many attempts to update this type of educational software, but one that impressed me is TRY.js (GitHub: s-a/TRY.js, License: MIT/GPL) by Stephan Ahlf:

TRY.js is supposed to program a virtual robot which moves in a 3D environment and is able to pick up and unload objects. The program gives beginners a first insight into the world of computer programming.

Due to the ease of use and the limited instruction set TRY.js is well suited for the introduction to programming, especially for learning the programming language JavaScript. It gives an overview about synchronous and asynchronous codes as well as test driven development.

It uses Google Drive so you can save your experiments and share them. There's also a project for sharing TRY.js packages.

If you want to try programming the robot, there's a Robot API on GitHub. Rather than trying to present a fake educational DSL, TRY.js embraces modern JavaScript idioms, so beginners would need assistance but it might help them to learn how people actually write web-based software -- complete with tests!



Guntis Smaukstelis sent in a powerful web-based game level editor for Phaser games called MightyEditor (GitHub: TheMightyFingers/mightyeditor, License, Demo). It supports asset management for organising textures, and there's a map editor so you can paint levels, with tools for scale and rotate. It also has a physics editor and code editing, so you can alter the behaviour of the game without exporting it first.

It's open source with the limitation that you can't create paid services on top of the MightyEditor, and you must reference the project's creator (mightyfingers.com) in your work. The company behind the editor also sells paid subscriptions, so you can support them if you use it for building your own games. Otherwise the licensing is flexible, and it seems like a powerful tool.


tutorials libraries games reactive data-binding

BindingJS, 2D Space Shooter Part 2

Posted on .


BindingJS (GitHub: rummelj / bindingjs, License: MPL) by Johannes Rummel is a data binding library that seeks to separate data binding declarations from HTML. It has a Less-inspired syntax for defining bindings, which you can put in a script element with the text/binding type.

JavaScript is used to set things up, and the API is fluent, so you can chain calls to configure things like the template fragment that a binding document applies to.

The binding syntax is similar to CSS, but because it's influenced by Less you'll find it easier to group properties with nesting.

Data is accessed through "adapters", so it's fairly easy to customise it to existing applications:

There are multiple view adapter such as value, text, attr or on that are already included in BindingJS. The qualifier of an adapter is a static instruction for the Adapter and is written directly behind the prefix, if that is only one character long. Otherwise it is separated by a colon from the prefix.

I like the idea of a CSS selector data binding language, but the expressions it uses are terse so it may take some effort to get the hang of BindingJS. Also, I think it would work well with custom elements, so it would be worth experimenting with that.

Part 2 of How to Make a 2D Space Shooter in Unity

Thomas Palef sent in part 2 of How to Make a 2D Space Shooter in Unity. This is the tutorial series that uses Unity's JavaScript API. In this part Thomas adds enemies and collision handling as well.


tutorials games node modules slideshows

Slideshow, Unity and JavaScript

Posted on .


What do you do when Apple and Microsoft do everything they can to pull us into their walled development environment gardens? One answer is to unify both environments using a sane Node API. Ralf S. Engelschall sent in Slideshow (GitHub: rse / slideshow, License: MPL, npm: slideshow), a module for remote controlling and monitoring presentation programs like PowerPoint and Keynote.

He also wrote slideshow-forecast, which is a cool CLI and GUI for monitoring slideshows:

The motivation for this is that for large presentations which have to be given in multiple variants for different timeslots it is very hard to determine the later presentation duration during preparation time. Instead of performing lots of different dry-runs after each preparation, this tool provides a duration prognosis already during preparation time.

The slideshow command-line program itself lets you drive an application with commands like boot, open file, and start. You can also goto a given slide and stop the presentation at the end.

Internally it uses Microsoft's cscript or Apple's osascript to communicate with the target application, so you don't have to worry about strange AppleScript or COM incantations.

How to Make a 2D Space Shooter in Unity


The Unity game engine is hugely popular with game developers. Many of the indie games that I've enjoyed have been made with it, and if I had the time I'd love to make something with it. I was aware Unity supports C#, but I didn't know it has a compiled JavaScript language as well.

Thomas Palef has written a new tutorial about using JavaScript with Unity called How to Make a 2D Space Shooter in Unity. It shows you how to get started making a game with Unity's UI, and includes some simple JavaScript for handling firing a bullet.

If you're interested in Unity but thought it was something that only desktop developers can get into then you might enjoy following this tutorial.


libraries events games modules di

js13k Winners, BottleJS

Posted on .

js13k Winners

Pest Control

The js13k winners have been announced. First place went to Pest Control: Weasels by Siorki, which is like Lemmings in reverse -- instead of saving little critters you have to kill them. It's a surprisingly fun game!

Felipe Alfonso came second with Extreme Mini Massacre, and Aurélio Santos came third with ap11. This is like a simplified GTA 1 clone, all in 13k!

There are 129 games listed on the site. Most genres are covered, and there are even some pretty unique ones like Whistleblower which allows you to use the microphone to whistle different pitches to defeat enemies.

The js13k participants get t-shirts and 3.5" diskettes that contain all of the entries. Just to show off how small browser games can be... For those of us without disk drives, however, the source is at js13kGames on GitHub.


BottleJS (GitHub: young-steveo / bottlejs, License: MIT, Bower: bottlejs, npm: bottlejs) by Stephen Young is a dependency injection micro container.

It's inspired by the AngularJS API. You can register services with bottle.service('Service', Service), and then construct them with bottle.container.Service. Bottle supports middleware, so you can inject functions that intercept requests for providers just before they're made for the first time.

If you're not using AngularJS and have trouble keeping larger applications maintainable and testable, then something like Bottle might help improve your application's structure. The readme has examples and API documentation to get you started.