Giter Club home page Giter Club logo

rajashekarraju / hangman-compose Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 5.0 6.86 MB

:video_game: Hangman Game for Android :robot: build with Compose :rocket:. 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 :rainbow: MD3.

License: Apache License 2.0

Kotlin 100.00%
composable compose-android compose-navigation hangman-game jetpack-components jetpack-compose koin-injection material-design repository-pattern room-database

hangman-compose's Introduction

🎮 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.

hangman-compose's People

Contributors

rajashekarraju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hangman-compose's Issues

Features & tasks

Keeping track of tasks.

  • In OnBoarding screen Add options for player to choose between three different difficulty levels easy, medium, hard.
  • Instead of random words, add country name guessing category. Based on length of country name decide the difficulty level.
  • In history screen, highlight those items which are won.
  • For each game history, save the date/time and level/difficulty for the History entity.
  • While alphabets reset before/after new word pops, create bubble/bounce effect animation for each alphabet.
  • Make a record of highest scoring game to show in game/onboarding screens.
  • Create a image or draw on canvas, this should be drawn behind history/onboarding screen just to create death game effect.
  • For all existing elements, make use of animated visibility and draw accordingly to capture players focus.
  • Optional - Add curtain reveal effect transition with hangman when game starts/exit.
  • Optional - Make changes to border/shapes matching the creepy font effect.
  • Optional - Create field for collecting player name once the game ends to show up in history.
  • Optional - Create rain effect of falling skull shapes in onboarding screen continuously.

Main tasks

As a user, when I'm in a game session,

  • I want to see my score history.
  • I want to be challenged with unique words only.
  • I want to know how many unique words I can still guess.

As a user, when I'm playing the match,

  • I want to know how many chances I still have.
  • I want to be able to try out letters in any order I want.
  • I want to know how many points I made when I completed a word.
  • I want that my game state is persisted.

Low end small screen devices issue.

Issues

  • Immersive mode not working as expected, since app isn't launching full immersive.
  • Made all screen scrollable if elements collapse or hide behind content.
  • Game/Onboarding screen content doesn't load properly for low end devices.

Pixel 3a

Sony

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.