/asteroids

Kotlin port of ForeignGuyMike's Asteroids project with changes, additional features and improvements

Primary LanguageKotlinMIT LicenseMIT

donate

asteroids

Kotlin port of ForeignGuyMike's Asteroids project with changes, additional features and improvements.

Gifs in Action

Gameplay on mobile

Captured on iOS (noted the degraded framerate for gif, it's smooth in real.) iOS gameplay gif

Controller support on Desktop

controller support high score controller interaction

Video in Action

Click on image to watch video.

desktop gameplay video mobile gameplay video

Changes, Additional Features, and Improvements

Ported work included followings

  • Works with Desktop, iOS (via MOE) (as MOE support was removed in libgdx), and Android
  • Ported completely to Kotlin utilizing several of Kotlin language features
  • Mobile build with control (touchpad and etc) suitable for mobile
  • Controller support for desktop; but fixed to use Xbox360 layout. If you use another brand, you have to edit code for button mapping.
  • Continued with initial intention of the project by using non-texture for game object, only shape-based via ShapeRenderer. Only texture used are bitmap which is dynamically generated in run time from .ttf font file via BitmapFont.
  • Avoid using java.awt.geom classes which are Line2D, and Point2D classes which are not supported on Android by creating a wrapper class with functionality intended to be used in this project; just hold the data.
  • BBInput, and BBInputProcessor are iterated from previous projects (BlockBunny, and OMO) and refactored to represent much better class to handle input all across the game. It supports keyboard, mouse, and controllers
  • Performance improvements
    • Improved draw call over the same type of object but with multiple instances. See IBatchShapeRenderable and IBatchWraperShapeRenderable.
    • Object pools are used to avoid creating new object every time
    • Proper clearing native resource via calling dispose() properly

Notice

  • Better utilize more lambda functions of Kotlin when necessary through out the project especially in Play
  • BBInput and BBInputProcessor handles all input from keyboard, mouse, and controller (with up to N players, set in source but this game is single player)
  • Properly handle to clear native resource via calling dispose()
  • Some screens check if game is running on mobile platform then dynamically add support for mobile interaction

License

MIT, Wasin Thonkaew

As ForeignGuyMike didn't mention or include any license to his project but generally publicize through video tutorial, so this project follows along with that intention, thus the decision to be MIT in this case.