diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..b62ea28 --- /dev/null +++ b/TODO.md @@ -0,0 +1,12 @@ +## Ideas for Gine 5 + +- Colission detection out of the box +- Map utilities (what exactly?!) +- Entity basics +- AI basics +- DevTools + - CLI + + +Type assets! + diff --git a/example/src/main.ts b/example/src/main.ts index 1d462f5..2c63a71 100644 --- a/example/src/main.ts +++ b/example/src/main.ts @@ -1,31 +1,31 @@ -import { Config, DEFAULT_CONFIG, Gine, IConfigArguments, Scene, SpriteOptions } from 'gine' +import { BasicAsset, Config, DEFAULT_CONFIG, Gine, IConfigArguments, Scene, SpriteOptions } from 'gine' import { filter } from 'rxjs/operators' import { LoadingScene } from './scenes/loading' import { MainScene } from './scenes/main' const cfg: Config = new Config( - document.querySelector('#game') as HTMLCanvasElement, - Object.assign(DEFAULT_CONFIG, { - width: 600, - height: 400, - tickRate: 120 - } as IConfigArguments) + document.querySelector('#game') as HTMLCanvasElement, + Object.assign(DEFAULT_CONFIG, { + width: 600, + height: 400, + tickRate: 120, + } as IConfigArguments) ) const game = new Gine(cfg) -const assets: any[] = [{ name: 'logo', src: 'logo.png' }] +const assets: BasicAsset[] = [{ name: 'logo', src: 'logo.png' }] assets.forEach(d => { - Gine.store.image(d.name, d.src) + Gine.store.image(d.name, d.src) }) Gine.store.sprite('player', 'spritesheet-example.png', { widthPerImage: 64, heightPerImage: 64, imagesPerRow: 5, numberOfFrames: 9, - ticksPerFrame: 24 - } as SpriteOptions) + ticksPerFrame: 24, +} as SpriteOptions) const loadingScene = new LoadingScene() game.changeScene(loadingScene) @@ -36,9 +36,9 @@ Gine.keyboard.key$.subscribe() Gine.mouse.mouse$.subscribe() Gine.events - .pipe(filter(ev => ev === Scene.DESTROY_CURRENT_SCENE)) - .subscribe(ev => { - game.changeScene(mainScene) - }) + .pipe(filter(ev => ev === Scene.DESTROY_CURRENT_SCENE)) + .subscribe(ev => { + game.changeScene(mainScene) + }) Gine.events.subscribe(ev => console.log(ev))