This is a well known Super Mario game recreated with TypeScript.
Original tutorial: Super Mario Bros in JavaScript
Currently I really don't like how I managed traits adding with TypeScript. I would love to hear a better solutions for such case.
type TraitType = Jump | Go | PendulumMoove | GoombaBehaviour | Stomper | Killable | PlayerController | KoopaBehaviour | Solid | Physics;
type TraitTypeTSworkaround = Jump & Go & PendulumMoove & GoombaBehaviour & Stomper & Killable & PlayerController & KoopaBehaviour & Solid & Physics;
addTrait(trait: TraitType) {
this.traits.push(trait);
this[trait.NAME] = trait as TraitTypeTSworkaround;
}