net - UK (2020-03)

(Antfer) #1

FEED
Side project


Tell us what your side project does.
GameController.JS (https://netm.ag/2FuWCsj) is a
JavaScript library that enables developers to manage
gamepads in all modern browsers. Its goal is to
remove the initial complexity of the original web API.

Why did you create it?
While searching for a web API to integrate in a
different project, I was surprised to find that there
was a standard Gamepad API. I enjoy playing games
and it had this cool factor that made it fun to learn.
After getting the first snippets working from
scratch, I realised that every step in the process
required many repetitive tasks and, although not
excessively complex, it was going to be difficult to
maintain. Building a library to simplify the interface
was a natural move and it almost happened without
even realising.

What were you hoping to achieve?
At the beginning, developing the library was more of
a personal and learning challenge but soon I came to
the realisation that I not only wanted to be the
developer of the library but also one of the users. And
after seeing how repetitive and tedious some of the
steps were, the goal in mind soon became simplicity.
The simpler and easier to use that the library was, the

better it would be for other developers (and myself) to
build interesting projects with it.

What technologies were used in building it?
The core of the library is the Gamepad API and its
extensions (like the game controller vibration). It was
built using Vanilla JS in an attempt to keep it free of
other libraries or plugin dependencies and also as
light as possible (the current version is around 6KB).

How has it been received?
The first people that tried the library – and gave the
thumbs up – were my four-year-old and two-year-
old children. They are still too little to play games like
Guitar Hero or Dance Dance Revolution but they enjoy
pretending to play with the drums and guitars. They
were excited when I used the library to build simple
versions of those games they could play with the
controllers connected to the browser.
Received warmly by the developer community,
GameController.JS is fairly recent but already several
projects started linking it as a dependency to build
web games with gamepad support.

What do you think you’ll do next with it?
The Gamepad API is an actively evolving document,
which means that GameController.JS has to be
updated often to keep up with the new changes. The
library needs some polishing, expanding it to include
more functionality and extensions and adding custom
JavaScript events.
As mentioned before, the next step would be for me
to become a user of the library and build a version of
a game like DDR with open and accessible features to
make it available for everyone.

SIDE PROJECT OF THE MONTH

ALVARO
MONTORO
Montoro is a software
engineer passionate
about web technologies
in general and HTML and
CSS in particular.
w: alvaromontoro.com
t: @alvaro_montoro

INFO

GAMECONTROLLER.JS


Alvaro Montoro on his library for putting


gamepad functionality in the hands of developers

Free download pdf