This Android app allows a user to play a simple puzzle game. The objective of the game is to obtain a specific quantity of liquid in a jug, with the restriction that you can only fill, empty and pour water from the jugs provided.
- Nice game mechanics, uses gestures for interactivity and animations
- 10 built-in levels, with custom level generator and random level generator
- About screen, ability to undo moves, retry game, and level verification if it's solvable or reasonable to solve
- Adjustable level generator difficulty, and level attempt rating generator
- Solution solver, using a top-down dynamic programming algorithm
- Includes highscores stored in an SQLite database (which can be reset through settings)
This app makes use of a significant amount of OOP principles. The most essential part of this app is the abstraction of a Jug
object, which the player interacts with. The Jug
object should be allowed to be filled, emptied, and then pour into another Jug
. Another important class would be the Scenario
class, which would indicate the level and level specific actions such as the goal, current state of jugs, and more. The solver, which includes a test solver, uses a caching BFS
algorithm (using a HashSet
for caches) to prevent recomputing the overlapping subcases. Alongside this, all moves are stored in a Stack
so the undo function can work. More abstractions are made for smaller features as well.
For highscores, all the scores are stored in an SQLite database
, with a HighscoreItem
encapsulating all of the information. The GameRenderer
draws the graphics all using relative geometry, so it scales properly on screens.
Feel free to contribute if you want to add any extra cool levels. The level generator will ensure that all levels generated will require at least the difficulty level's amount of steps, with a 10% chance that it will contain a jug with a capacity of 1L.
You can find the documentation in the /doc/
folder.
There are no known issues.