Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdionysus committed Apr 22, 2020
1 parent d4654a6 commit 2a7a224
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 14 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@
[![Coverage Status](https://coveralls.io/repos/github/tomdionysus/tenkai/badge.svg?branch=master)](https://coveralls.io/github/tomdionysus/tenkai?branch=master)
[![NPM version](https://img.shields.io/npm/v/tenkai.svg)](https://www.npmjs.com/package/tenkai)

Tenkai is a 2D game engine written in JavaScript.
Tenkai is a 2D game engine written in JavaScript. It is designed to create games that run in the browser using standard PNG/JPG/MP3 assets, supporting multiple nested scenes and entities (sprites/mobs), audio and sfx, and an event driven management system.

When combined with the [Electron](https://electronjs.org/) project, Tenkai can be used to build standalone games that run on a variety of platforms including Windows, MacOS and Linux.

## Installation

```
npm install
npm install tenkai
```

## Testing
## Documentation

```
npm test
```
Tenkai is a set of ES2015 classes designed to be complied to a JS application for the browser using [Browserify](http://browserify.org/) or another similar toolchain. A blank game project with an on-demand complier and an [Electron](https://electronjs.org) build toolchain is available.

## Documentation
* *Concepts* - [See an overview of the concepts in Tenkai here](docs/concepts).
* *HOWTOs* - [See general HOWTOs and example projects here](docs/howotos).

### `npm` Package Documentation

Please see [tomdionysus.github.io/tenkai](https://tomdionysus.github.io/tenkai/) for documentation.
* Tenkai[tomdionysus.github.io/tenkai](https://tomdionysus.github.io/tenkai/) for documentation.
31 changes: 31 additions & 0 deletions docs/concepts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Tenkai - Concepts

## GameEngine
The Tenkai GameEngine is a viewport bound to a `<canvas>` DOM element which contains the game.

The GameEngine is responsible for the top of the draw tree, and repaints the viewport every browser 'animation frame'.

The GameEngine can contain multiple Scenes, and also host its own Entities.

## Asset
An asset is a source for graphics in a game. The graphics could be background images, or tiles for TiledScenes or Entities (Animation frames).

A single asset can be used by multiple Entities and/or Scenes.

## Scene
A Scene is a a container for other Scenes and Entities, that may also contain a static background graphic, or a tiled map background.

Scenes can also contain child scenes which are independently drawn.

### BackgroundScene
A BackgroundScene is a Scene with a single background image drawn from an asset. The background image can be scaled or scrolled.

### TiledScene
A TiledScene is a Scene where the background image is composed of a grid of tiles - regular rectangular regions in the asset. In this way, a set of quite simple tiles can build up a complex background image, according to a tile map contained in the TiledScene. The background image resulting from mapping the tiles can be scaled or scrolled.

## Entity
An Entity is a graphic that can (optionally) be moved and animated. These are also known as sprites or mobs, and are used to represent characters or objects in the game. Entities are also used for props in a scene.

Entities draw their graphics from an Asset, which is divided into tiles - regular rectangular regions in the asset. The size of these tiles is defined when creating the Entity. For instance, an Asset may contain a large amount of 32x32 pixel tiles, each of which represents a frame in an animation. The Entity can select which tiles is currently shown, and animation is achieved by rapidly changing the tile.

Entities can also contain child Entities which are independently animated.
1 change: 1 addition & 0 deletions docs/howto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Tenkai - HOWTOs
18 changes: 12 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,21 @@ <h3> </h3>
<p><a href="https://travis-ci.org/tomdionysus/tenkai"><img src="https://img.shields.io/travis/tomdionysus/tenkai/master.svg" alt="Build Status"></a>
<a href="https://coveralls.io/github/tomdionysus/tenkai?branch=master"><img src="https://coveralls.io/repos/github/tomdionysus/tenkai/badge.svg?branch=master" alt="Coverage Status"></a>
<a href="https://www.npmjs.com/package/tenkai"><img src="https://img.shields.io/npm/v/tenkai.svg" alt="NPM version"></a></p>
<p>Tenkai is a 2D game engine written in JavaScript.</p>
<p>Tenkai is a 2D game engine written in JavaScript. It is designed to create games that run in the browser using standard PNG/JPG/MP3 assets, supporting multiple nested scenes and entities (sprites/mobs), audio and sfx, and an event driven management system.</p>
<p>When combined with the <a href="https://electronjs.org/">Electron</a> project, Tenkai can be used to build standalone games that run on a variety of platforms including Windows, MacOS and Linux.</p>
<h2>Installation</h2>
<pre class="prettyprint source"><code>npm install
</code></pre>
<h2>Testing</h2>
<pre class="prettyprint source"><code>npm test
<pre class="prettyprint source"><code>npm install tenkai
</code></pre>
<h2>Documentation</h2>
<p>Please see <a href="https://tomdionysus.github.io/tenkai/">tomdionysus.github.io/tenkai</a> for documentation.</p></article>
<p>Tenkai is a set of ES2015 classes designed to be complied to a JS application for the browser using <a href="http://browserify.org/">Browserify</a> or another similar toolchain. A blank game project with an on-demand complier and an <a href="https://electronjs.org">Electron</a> build toolchain is available.</p>
<ul>
<li><em>Concepts</em> - <a href="docs/concepts">See an overview of the concepts in Tenkai here</a>.</li>
<li><em>HOWTOs</em> - <a href="docs/howotos">See general HOWTOs and example projects here</a>.</li>
</ul>
<h3><code>npm</code> Package Documentation</h3>
<ul>
<li>Tenkai<a href="https://tomdionysus.github.io/tenkai/">tomdionysus.github.io/tenkai</a> for documentation.</li>
</ul></article>
</section>


Expand Down

0 comments on commit 2a7a224

Please sign in to comment.