DJ Quilter

Front-End Developer

RPG JS (Phase I): Introduction to a Side Project

RPG JS is a project that I’m going to use to push my Javscript skills. (I am well aware that this is a rubbish name for a game, and will endeavour to come up with a better one in the future.) My broad aim is to build a HTML5 game using as few Javascript libraries as possible. As such, the intended user will be using a modern browser.

The game itself will be a top-down roleplaying game (hence the awful name), in the style of Zelda or Pokemon. It will likely be a tradition Middle-Earth-type setting, although I haven’t really thought much further than the mechanics of the game at the moment. I would like the game to be extensible in terms of setting, story and elements. This basically means that I’d like to be able to add new character types (read races and animals), items (read weapons and environmental objects – so trees and stuff), and potentially quests. With regards to the last, I’m toying with creating a sandbox or a specific narrative. Tied to this is the potential to create a world that is programmatically generated. This sounds very complicated though, so I’m just going to get some more basic work done before thinking about either of those questions (which may well be the wrong way to go about this – but whatever, it’s my project!).

In setting up the project, I’ve completed the most basic of tasks:

  • Using the module pattern, I’ve created the basic script which sets everything up. This includes a grid of ’tiles’, which constitutes the game map, and an avatar for the user.
  • Using Javscript prototypes I set up a basic movement method for the avatar, with a view to adding further methods which are reusable for future in-game characters.
  • The avatar is able to move between the ’tiles’, and the movement is animated via CSS transitions. The avatar is tracked (via data-attributes), and currently not able to move out of the bounds of the game map, but will be able to move to other maps in the future.

And without further ado, here is RPG JS version 0.1:

You can find the up-to-date Github repository for RPG JS here.