How to use excalibur - 8 common examples

To help you get started, we’ve selected a few excalibur examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github excaliburjs / example-ts-webpack / src / actors / player / player.ts View on Github external
import * as ex from 'excalibur';

export class Player extends ex.Actor {
  constructor() {
    super({
      pos: new ex.Vector(150, 150),
      width: 25,
      height: 25,
      color: new ex.Color(255, 255, 255)
    });
  }
}
github excaliburjs / example-ts-webpack / src / actors / player / player.ts View on Github external
constructor() {
    super({
      pos: new ex.Vector(150, 150),
      width: 25,
      height: 25,
      color: new ex.Color(255, 255, 255)
    });
  }
}
github excaliburjs / example-ts-webpack / src / index.ts View on Github external
constructor() {
    super({ width: 800, height: 600, displayMode: ex.DisplayMode.FullScreen });
  }
github excaliburjs / example-ts-webpack / index.ts View on Github external
import * as ex from 'excalibur';

var game = new ex.Engine({ width: 500, height: 500 });
var hello = new ex.Label('Hello World', 100, 100, 'Arial');
hello.color = ex.Color.Red;
hello.fontSize = 20;

game.add(hello);
game.start();
github excaliburjs / example-ts-webpack / index.ts View on Github external
import * as ex from 'excalibur';

var game = new ex.Engine({ width: 500, height: 500 });
var hello = new ex.Label('Hello World', 100, 100, 'Arial');
hello.color = ex.Color.Red;
hello.fontSize = 20;

game.add(hello);
game.start();
github excaliburjs / example-ts-webpack / src / index.ts View on Github external
public start(loader: ex.Loader) {
    return super.start(loader);
  }
}

const game = new Game();
const levelOne = new LevelOne(game);
const player = new Player();
player.addDrawing(Resources.Sword);

levelOne.add(player);

game.add('levelOne', levelOne);


let loader = new ex.Loader();
for (let key in Resources) {
  loader.addResource(Resources[key]);
}

game.start(loader).then(() => {
  game.goToScene('levelOne');
});
github excaliburjs / example-ts-webpack / src / resources.ts View on Github external
import * as ex from 'excalibur';
const sword = require('./images/sword.png');

let Resources = {
    Sword: new ex.Texture(sword)
}

export { Resources }
github excaliburjs / example-ts-webpack / src / actors / player / player.ts View on Github external
constructor() {
    super({
      pos: new ex.Vector(150, 150),
      width: 25,
      height: 25,
      color: new ex.Color(255, 255, 255)
    });
  }
}

excalibur

Excalibur.js is a simple JavaScript game engine with TypeScript bindings for making 2D games in HTML5 Canvas. Our mission is to make web game development as simple as possible.

BSD-2-Clause
Latest version published 9 days ago

Package Health Score

87 / 100
Full package analysis