0.1.9 • Published 7 years ago

bloodgine v0.1.9

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

Simple game engine for HTML5 games written in Typescript.

Built on Pixi.js for rendering.

Features:

  1. States (Menu, Game, Pause etc) with support for displaying a state on top of another (great for e.g. pause menu or combat on a map)
  2. Input handling (Keyboard, Mouse, Gamepad) - can also use Pixi-sprites if you want to do it that way
  3. Crude camera support
  4. Resolution scaling
  5. Basic Tiled map support
  6. 2d grid class and A-star path finding
  7. EC (Entity + component system), no support for systems built in
  8. Simple Ambient lighting
  9. Noise and noise maps (Maps, Islands) generated from simplex-noise
  10. Turn based support (works, but not fancy) and Ability/Spell system (also in beginning state, works but no more ;))
  11. Some UI features like basic buttons, text, control list
  12. Some Electron integration for Desktop based games
  13. Basic Particle system
  14. Audio through Howler.js
  15. Tweening with tween.js

Example in Typescript:

SuperDuperGame.ts:

import * as engine from 'bloodgine'
import * as PIXI from 'pixi.js'

class SuperDuperGame extends engine.GameCore {
    initialize() {
        this.pushState(new MainMenuState());
    }
}

let game = new SuperDuperGame();
game.run();


export default class MainMenuState extends engine.State {
    init(game:engine.GameCore) {
      // setup entities, gui etc here
    }

    destroy(game:engine.GameCore) {
      // remove anything you don't want to ase anymore, most things gets removed automatically
    }

    update(game:engine.GameCore, dt:number) {
        if(engine.Input.keyPressed(engine.Input.Keys.e)) {
            console.log("pressed e");
        }

        /// Returns false if this state does not want further updates down the state stack
        return false;
    }
}

Motivation

I wanted to start making games in HTML5 and typescript. So I have done some work with Phaser but I just wanted to create something myself from scratch that has everything I want for my games, simple solution; just roll my own ;)

Installation

Install the engine with npm (if thats what you prefer):

npm install bloodgine

Tests

Currently there are no tests written for anything, code is provided as is.

Contributors

If you want to add/contribute to the project I would be more than happy to accept PRs or anything.

License

MIT

0.1.9

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago