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.
We are going to make the game area smaller by adding a column to each side. We will place the new UI elements there and we will link them to GameObjects
to update them as the game progresses.
While we could overlay the controls on top of the GameView
instead of having letterboxes, note that we are using...