Simple android game with online functionality
Hi everyone!

Topics covered in this project are:

* game made using the Kivy Python module
* compiling with buildozer (and spec file) to get an .aab file
* using the 'kv' language
* using Kivy to switch between screens, display graphs, etc.
* online functionality (e.g. leaderboard) using firebase
* firebase rules
* app splash screen

&amp;#x200B;

showcase video: [https://youtu.be/PFNS4bGSocQ](https://youtu.be/PFNS4bGSocQ)

github:  [https://github.com/Contraposite/PrimeFactorization](https://github.com/Contraposite/PrimeFactorization)

buildozer method I followed:  [Creating an AAB for python apps using Buildozer (github.com)](https://gist.github.com/Guhan-SenSam/35c5ed7da254a7c0141e6a8b6101eb33)

play store listing:  [Prime Factorizer Game - Apps on Google Play](https://play.google.com/store/apps/details?id=com.jf.primefactorizer)

This is my first app, which I wrote in Python and the 'kv' language, using Kivy, compiled to create an android app bundle using buildozer, and successfully uploaded to the Google Play Store.

There is a reasonable amount of support for Kivy but not too much for using it with firebase, so I hope this helps some people trying to make something similar. My github link includes my buildozer spec file and a text file of my firebase rules.

The premise of my game is simple: you're shown a target number, and you need to use the on-screen buttons to input the prime factors of that number, in order of smallest to largest (e.g. for target number 66, the prime factors are 2, 3, and 11, so you would press '2 3 1 1'. You are timed, and each time you complete a target, you get a new one. Target numbers get larger with time so that there is some difficulty progression.

Most of the functionality is shown in the linked video above, but some notable things are that you can create an online profile or play fully offline, the game shows you a variety of stats and graphs of your past play data, there are search functions to find points shown on the graphs, there is an online scoreboard, with a graph showing the leaderboard entries overlapped. You can also view the stats and graphs of other online players.

There are two glitches that I ran into with Kivy:

* kivy-garden scatterplot graphs sometimes have a graphical issue where the data points disappear and are not redrawn. The workaround was to redraw the graph with a slightly different size (I added a numpy random number times a negligibly small number to the size I actually needed).
* in the kivy textboxes, if the user types an '@' sign while the font size is large, it can crash the app. Definitely one of the most bizarre glitches I've ever encountered, but I just kept the font size small to avoid it.

I tried to add sounds for button feedback, but there was too much of a delay and it wasn't very good, so I've taken it out and plan to add sounds sometime in the future with another method to avoid the delay.