Using Kiwi.js with Typescript vs Javascript

The Kiwi.js library is written using Typescript. Users of the library have the choice of either using Typescript or Javascript to create games.

The library makes use of Typescripts ability to emulate some classical object orientation practices,  in particular the ability to extend classes. In some cases game developers using Kiwi.js with Javascript will need to extend classes. As Javascript uses prototypal inheritance this is one area where using TS/JS differs significantly. Kiwi.js does not prescribe how JS developers should manage this, however here are some recommendations and suggestions.

Two very commonly used parts of the Kiwi.js make use of inheritance, States and GameObjects. Both will be considered separately.

To learn about extending States read this guide.

To learn about extending GameObjects read this guide.

Share the joy

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">