Euskit User Guide

Introduction

Euskit (pronounced you-skit) is a game engine for HTML5/Web games. It is specifically made for making retro-looking 2D games with pixel art. Growing up in 80s in Japan, those arcade games have always a special place in me. This is my attempt to headstart in several game jams that I participated. The engine is designed to be lightweight and self-contained in that it doesn't depend on any external library except TypeScript. It is licensed under MIT License.

Getting Started

The following instruction applies both Windows and Unix (or Mac).

  1. Install Node.js and TypeScript.
    > npm install -g typescript
    
  2. Copy the skel directory as your working directory:

    (On Unix, this can be also done by running the following script.)

    $ ./tools/setup.sh /path/to/project
    
  3. Run tsc at the working directory.
    > tsc
    
  4. Open the index.html file.

Big Picture

Here are the important concepts in Euskit:

App Images, ... Scene Scene ... Sprite Entity World
App: Resource management and event loop.
Scene: Game state management and event handling.
World: Container where Entities are placed in.
Entity: In-game character.
Sprite: Graphical object to be shown.

Key Classes

App
Every game has exactly one App object. It does the basic pluming and resource management (images and sounds); it has an event loop and connect all the external parts (i.e. a browser) to the game. Typically, you don't have to change this part.
Scene
A Scene can be thought of a mini-app or "mode" within the App. It's pretty much an event handler that manages the in-game states. This is primarily what a Euskit user will write. Euskit supports multiple Scenes, but it's possible to create an entire game with just one Scene.
Entity
An Entity is a bit like a GameObject in Unity. (Unlike Unity, however, Euskit uses a traditional hierarchical model instead of components.) Each Entity has its own process, Collider and one or more Sprites. Once you place an Entity in the game world, it moves on its own. A Rect is typically used for Collider in 2D games.
World
A World is where Entitys belong to. It is basically a container that manages the state of each Entity and performs basic collision handling.
Sprite
A Sprite is something to be displayed. It has a location, rotation and the reference to its content. Unlike some other engines, Sprite doesn't know how to move itself. It is just sitting at a certain location on screen. Scene or Entity is responsible to change/move its position.
Task
Each Entity is a subclass of Task. A Task is an independent object that runs by itself. It is often convenient to create a short-lived task for a delayed action (see the examples).
Signal
Signal is much like C# events, but it is renamed here to avoid confusing with HTML5 events. Unlike EventListener class in HTML5, Each Signals are distinguished not by strings but by variables (see the examples).

How To Make Games Like...

1. Platformer

TODO

2. Shooter

TODO