/ts-game

TypeScript WebGL Game Framework

Primary LanguageTypeScriptMIT LicenseMIT

TypeScript WebGL Game Framework

In theory it is small code-oriented framework for building html5 games.
In fact it is just a beginning of that.

Quick demo

Simple shooter game gif

Features

In alphabetical order:

  • GUI
    • Button
  • Helpers
    • Action manager — perform actions (simple or continuos) with pause, chain them and so on. No more timers and flags in update() method
    • Event — simple observable with subscribe functionality
    • Pool — do not create/delete items with short time to life. Reuse them.
    • Tween — perform curve based animations
  • Input — keyboard, mouse, touches
  • Asset loading — async with promises
  • Math — vectors, matrices
  • Physics — simple collision detection
  • Render
    • WebGL renderer
    • Texture atlases
    • Font rendering
  • Render 2D
    • Sprite
    • Text
  • Scene
    • Node
    • Camera
  • Scenes — game, menu, options, pause management routines
  • Sound — play sounds and music

What features are in progress?

Global roadmap

  • 2D graphics full support
  • 2D physics
  • 2D games
  • 3D graphics

Quick start

  1. Install node.js with npm (https://nodejs.org/en/)
  2. Open your favorite IDE/editor. I prefer Visual Studio Code.
  3. Open your favorite terminal (bash, cmd, powershell) at project's root folder
  4. Type $ npm install or $ npm i for package restore
  5. Run game: $ npm run start:{game} with dev server and hot reload or
  6. Get release: $ npm run build:{game} — minified and optimized build at /dist/{game} folder