Kotlin port with changes and improvements for omo originally by ForeignGuyMike, on PC, Android and iOS (via MOE).
Following is changes from original project
- Support running on PC for any resolution (also support wide-screen)
- Buildable on iOS via MOE
- Fixed transition effect between game state to applies to whole screen
- Fixed touch checking for any screen resolution (via
unproject()with specified of currentViewport's width and height) - Slightly better organization of
Tileclass spanning intoSizingTilefor use as normal tile in gameplay sessionGlowTilefor use as tile effect when touch on tile to select it, it includes ability to set type of do contracting effect as wellExpandingTilefor use as transitioning effect when switch between one game state to another
- Flexible touch to select/deselect tiles via dragging. Support up to 2 fingers at the same time
- Save save to save highscore for each difficulty
- Added support for rendering space, + (plus), and - (minus) symbol from spritesheet
- Safer using of score to save as highscore (if beaten), and supply in Score screen
- Background music, and sfx across the game
Interesting points to look at regarding Kotlin language features used in the project
- Make use of
Arrayinitialization with initializing function that usesalsoto reduces line of code and manual two-for-loop iteration into just technically 1 line of code. - Use
forEachwhenever possible - 2 dimensional array declaration i.e.
Array<Array<ExpandingTile>> open classto allow other classes to extend it i.eTileclass- Customized getter function for class's properties that not just return its backing field but involves condition checking to return
Boolean - Use
let { }to play music and sfxs across the project in which it sets volume at the same time. Intend to not have a separate class to handle playing sounds.
Interesting points to look at regarding to libgdx
- Multiple Cameras and Viewports to achieve rendering normal game state's content, and transition effect together at the same time. Lesson learned, don't forget to call
Viewport.apply()for your current active Viewport before rendering withSpriteBatchto make such Viewport active. - Use both
FitViewportfor gameplay content, andExtendViewportfor transition effect (whole screen) Camera.unproject()that applies screen width, and hieght from specifiedViewportmaking resolution independence when check touching position
I made background music using MilkyTracker, you can give me support and download it on Bandcamp. For all sfx, I use bfxr to create them.
If you follow along with the tutorial videos, you can checkout part1 -> part8 branch of this repository to have a ready code for end result from each video tutorial.
All in all, it's optional, and master is mostly the one you're looking at.
MIT, Wasin Thonkaew
You should not just use code in this project, and make a copy of game to publish. Please note that ForeignGuyMike published his original idea (OMO) to Google Play.
You can use the code, adapt it into your own project, or modify the game further with different game design etc so it's not complete rip-off, then you are clear to publish the game.
For background music, it's under CC Attibution 3.0. That means you are free to use, modify or further use in personal or commercial project but giving credits back to me is required. Anyway for sfxs are free to use in anyway you want.