Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/excaliburjs/sample-platformer. Sample Platformer built in Excalibur excaliburjs.com/sample-platformer
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940import{Engine, Color, vec}from 'excalibur';import { loader } from './resources';import { Level } from './level';
const engine = new Engine({ backgroundColor: Color.fromHex('#5fcde4'), width: 600, height: 400, fixedUpdateFps: 60, // Turn off anti-aliasing for pixel art graphics antialiasing: false, physics: { // Set global gravity, 800 pixels/sec^2 gravity: vec(0, 800) }});
// Setup first level as a custom sceneconst level = new Level();engine.add('level', level);engine.goToScene('level');
// Game events to handleengine.on('hidden', () => { console.log('pause'); engine.stop();});engine.on('visible', () => { console.log('start'); engine.start();});
// Start the engineengine.start(loader).then(() => { console.log('game start');});
// For test hook(window as any).engine = engine;(window as any).level = level;