The GameFragment
Now that we have tweaked the main menu, it is time to work on the GameFragment
.
There are two essential game features we have not even built yet: score and lives. We are going remedy that now. First we need to make space for them in the layout, then we have to write some code to actually take care of both features.
For the UI of the score and lives we are going to use standard Android components. We have built a lot of features into our GameEngine
, but we do not want to reinvent the wheel. Since Android provides a good way to define layouts and make UIs we are familiar with, it would be a waste to not make use of it.
Note
Using the standard Android Views can save you a lot of time.
We are going to make the game area smaller by adding ...
Get Android Game Programming: A Developer’s Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.