Skip to content

🎮 Hangman Game for Android 🤖 build with Compose 🚀. Built with jetpack components, Room for saving game history, preferences for loading game settings, ViewModels for persisting game state, LiveData/States for observing states, Koin for DI, minimal compose animations for good UX, Light/Dark theme 🌈 MD3.

License

Notifications You must be signed in to change notification settings

RajashekarRaju/hangman-compose

Repository files navigation

🎮 Hangman - Built With Compose 🖌️

Thanks to Cicero Hellmann For giving this cool idea to build Hangman game with Compose for Android.

Game Banner

⬇️ Download

🎇 What's New: v0.1.0

  • Players will be challenged with unique words only.
  • Players can view their score/game history.
  • Players should know how many unique words can still guess.
  • Players can see how many attempts they have to guess the word.
  • Players can try out letters in any order they want.
  • Players can to know how many points made when I completed a word.
  • Players can to know how many points scored by completing all levels.
  • Persist the game state at any point of the game.

🎢 Roadmap: v0.2.0

  • Support game in landscape mode.
  • Add more guessing categories.
  • Players can have hints for each level.
  • Improve game user experience.
  • Fix issues for smaller screen devices.
  • Replace all Shared Preferences with DataStore.

🍡 App Overview

Screen Red Theme Teal Theme
OnBoarding Screen

• Default destination for the app.
• Players can choose different game categories from dialog.
• Players can choose difficulty mode through slider.
• Highest score will automatically update from game history data.
• Players can mute/unmute game background music.
• Players can read the game instructions from dialog.
• Shared preferences are used to save game category and difficulty.
Game Screen

• Destination for playing the game.
• Game loads with default game preferences last saved by the player.
• Players can check their points and current level.
• Players can view the number of attempts left to guess the word.
• Once player completes all levels, a dialog will show up with total points scored.
• At any level if player loses the game, dialog will be shown with word which isn't guessed correctly.
• Can access the game instructions dialog to see which game mode is running.
• Players cannot reuse the same letter which is already guessed.
• Players cannot directly exit the game, a modal sheet will confirm the exit.
• Players can view which letters are correctly being guessed.
History Screen

• Players can see their whole game history.
• Made use of room database to store all the history data.
• Each game history item has properties overall score, category, difficulty, level, won/lost info, time/date of play will be saved.
• Any specific game item history can be deleted from database by swiping.
• When no history is available a simple text message will be shown.
• Game progress will be saved only when player loses or wins but not when exits.
Adjust Difficulty Mode Game Instructions Game Exit Modal Sheet
Game Won Dialog Game Lost Dialog Game Exit

⏳ Experiencing slow game performance ?

Rendering times with Compose is slower compared to XML. I've added few references below which could help you improve app performance.

  • Change app module to choose build variant Release mode.
  • Enable R8 and disable debug to speed up the performance

References 📑

🎃 Teal/Red Theme Colors

val TealColorPalette = lightColors(
  primary = tealPrimary,
  background = tealBackground,
  onBackground = tealOnBackground,
  surface = tealSurface,
  onSurface = tealOnSurface
)

val RedColorPalette = darkColors(
  primary = redPrimary,
  background = redBackground,
  onBackground = redOnBackground,
  surface = redSurface,
  onSurface = redOnSurface
)

💡 Motivation and Context

Jetpack Compose is Android’s modern toolkit for building native UI. It enables you to quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs.

Understanding to implement own Theme Shape Typography Color has became bit easier by referring to lot of official jetpack compose samples which are available in GitHub.

Best of all we got to do this in Kotlin way. Excited and long way to go from here.

📢 What To Contribute ?

  • Have a cool idea or feature request? Start a discussion.
  • Want to contribute or add new feature to app? Send your pull request.
  • Game crashes while playing? Open a new issue, describe the problem.

🏆 Credits

🔊 Game Sounds - Pixabay.com

PIXABAY LICENSE CERTIFICATE

All sounds used in game are only for user experience purpose.
I do not own any of those audio content. All credit belongs to Music Author
uploaded to Pixabay.

I hold the licenses for audio files used in this app. Verify all license certificates.

✒️ Creepster Font

This fonts is licensed under the Open Font License, this is the only font I've used in my app.

You can refer to this font from Google Fonts.

👾 Icons

For the background images I have used in game, I have modified and used few icons from unDraw and iconscout.

📜 License

Copyright 2022 Rajasekhar K E

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

🎮 Hangman Game for Android 🤖 build with Compose 🚀. Built with jetpack components, Room for saving game history, preferences for loading game settings, ViewModels for persisting game state, LiveData/States for observing states, Koin for DI, minimal compose animations for good UX, Light/Dark theme 🌈 MD3.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages