Skip to content

SteveWaggoner/KotlinPhysics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KotlinPhysics

Demo of Kotlin JS with PixiJS display

Alt text LiveDemo

Description

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.

Couple of things about the code

  • Thread and Coroutines didn't seem to work in Kotlin JS. So, the Runnable.kt and Runner.kt will run code for the browser. These classes are like timer with a tick() 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.

Final Thoughts

  • 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.

About

Demo of Kotlin JS with PixiJS display

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published