Kotlin port of ForeignGuyMike's Asteroids project with changes, additional features and improvements.
Captured on iOS (noted the degraded framerate for gif, it's smooth in real.)
Click on image to watch video.
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 viaBitmapFont
. - Avoid using
java.awt.geom
classes which areLine2D
, andPoint2D
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
- 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
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.