/PRG08-Typescript-Game

PRG08 Typescript Game

Primary LanguageTypeScript

PRG08-Typescript-Game

Class diagram

Pull requests

Week 4: Pull request

Week 6:

Singleton

The Singleton pattern is applied at the game instance:

public static getInstance() {
    if (!Game.gameInstance) {
        Game.gameInstance = new Game();
    }
    return Game.gameInstance;
}

It is called by the following code:

window.addEventListener("load", function () {
    let game = Game.getInstance();
});

Polymorphism

Strategy pattern

Observers