You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
688 B

import { Engine, Loader, DisplayMode } from 'excalibur'
import { Beginning } from './scenes/beginning'
import { Player } from './actors/player'
import { Resources } from './resources'
class Game extends Engine {
private player: Player
private beginning: Beginning
constructor() {
super({ displayMode: DisplayMode.FitScreen })
}
public start() {
this.beginning = new Beginning()
this.player = new Player()
this.beginning.add(this.player)
game.add('beginning', this.beginning)
const loader = new Loader(Object.values(Resources))
return super.start(loader)
}
}
const game = new Game()
game.start().then(() => {
game.goToScene('beginning')
})