Demo of Kotlin JS with PixiJS display
This is a Kotlin port of Mike Wilkerson's Java 2D Physics Engine but using PixiJS for the display. Github has a couple of Kotlin-Pixi wrappers but these are out of date. So, the project includes my very primative Pixi wrapper that at least compiles and does basic graphics. Not really suitable for much else.
- Thread and Coroutines didn't seem to work in Kotlin JS. So, the
Runnable.kt
andRunner.kt
will run code for the browser. These classes are like timer with atick()
event. For animation, these were easier to use than threads. - The Kotlin-Pixi wrapper can easily be expanded by adding classes to the
PIXI.kt
. Just add them to the PIXI object and the namespace in both Kotlin and Javascript would be the same. For example,PIXI.Graphics
is the class name in both Kotlin and Javascript languages.
- Kotlin is a nice language when used with Intellij IDEA. Also, more readable than some Scala code.
- Scala has more support. Loading a full PIXIJS fascade was a one liner. And Kotlin noone has even wrote one yet.