A word puzzle game based on android jetpack compose.
This project is open-source and any one is most welcome to contribute but remember that before uploading to play store, modify all resources e.g., images, audios etc. All the resources that belongs to the project/author including brand "LexiLink" are strictly prohibited to use in your commercial release. In case of violation, your app will be reported and suspended from play store/app store.
Used Technologies:
- Jetpack Compose
- Canvas
- Animation
- Dagger-Hilt
- Room Database
- MVVM
- Navigation Component
- Single Activity and Multiple Screens
- Just Clone the repo and done!.
There are two screen composables (screens) Main Screen which have play/settings buttons and gameview which have the actual game. It is quite simple and easy to understand.
Every thing resides in ui>screens>gameview package. This package containes two files, one is viewmodel and second is gamveview composable.
GameView is divided into two parts, one is top and second is bottom. The top section contains the solution pad which letters will be showed invisible/visible. Second and the bottom part contains keypad which can be used to select letters.
Gems are initialized on this screen: SplashActivity.kt
CoroutineScope(Dispatchers.IO).launch{
//Check if app is installed first time. if
//First time then initial free gems are provided
GemShopManager.initializeSharedPrefs(mContext)
if(GemShopManager.isFirstInstallation()){
GemShopManager.initializeGemsTotal()
GemShopManager.setFirstInstallationStatus(false)
}
}
Code below in GameScreen.kt is responsible to initialy prepare the level/
GameScreenViewModel.kt has all related methods
LaunchedEffect(Unit) {
viewModel.prepareLevel()
}
Top bar contains two sections. One to display level and second is to show available gems. It takes two params, level and gems which is already provided by viewmodel.
fun TopBar(level:String, gems:Int)
It has two callbacks, one to trigger hint and second to shuffle the letters.
On hint, gems are first checked, if it has enough gems then gems are consumed and hint is provided.
Note: GemShopManager.kt which is responsible to manage gems, resides in utils package
BottomBar(
onHintClicked = {},
onShuffleClicked = {}
)
Add button is only visible if gems are not enough to consume. The consume amount can be changed in GemShopManager.kt
val adbuttonmodifier = Modifier
.size(80.dp)
.align(Alignment.CenterEnd)
ButtonWatchAd(
modifier = adbuttonmodifier
){
//Show your add here
}
Note: I will gradually update the documentation.
If you want to donate then you are welcome to buy me a cup of tea via PATREON because this encourages me to give you more free stuff and continue to maintain this library