This page is work-in-progress. You can reach me on twitter or mail to rezoner1337@gmail.com

Welcome to Playground.js

Introduction to Playground.js - essential javascript game framework.

Go through 6 simple steps to boot an application.

Getting started

Javascript game is a website. Let's start by creating one.

Create a folder and a text file named index.html in it. Contents below:

<!doctype html>

<html>

  <title>Name your game</title>

  <body>

  </body>

</html>

Including scripts

Create an empty text file main.js and put it in script/ folder.

Download playground.js and also put it in script/ folder

You should end up with a structure like this:

script/
    main.js
    playground.js
index.html

Update part of index.html to include following scripts:

<body>

  <script src="script/playground.js"></script>
  <script src="script/main.js"></script>

</body>

Creating an application

This is where playground.js lends you a hand. It will take care of basic communication between mouse, keyboard and screen.

Update main.js using following contents:

var app = playground({

});

Note: if you are familiar with javascript you might prefer

var app = new PLAYGROUND.Application({

});

Note: if you are not-familiar - pick whichever looks better to you (it doesn't matter)

Double click index.html to run it in a default browser

You should be able to see loading screen. In the next part we will draw something.

Ask question:

Fork me on GitHub