I'm developing my first game using Visual Studio, Phaser and Typescript.
I can't get my classes to work when I use the extends key word
This works:
class Game {
game: Phaser.Game;
constructor() {
// init game
this.game = new Phaser.Game(window.innerWidth * window.devicePixelRatio - 20, window.innerHeight * window.devicePixelRatio - 20, Phaser.CANVAS, 'content', State);
}
}
This does not:
class Game extends Phaser.Game{
constructor() {
// init game
super(window.innerWidth * window.devicePixelRatio - 20, window.innerHeight * window.devicePixelRatio - 20, Phaser.CANVAS, 'content', State);
}
}
I've been trying to figure this out all day without success, can anybody shed some light on it?