Displaying multiple pickups of the same object with multiple status icons
If there is a small, fixed total number of an item to be collected rather than text totals, an alternative effective UI approach is to display placeholder icons (empty or greyed out pictures) to show the user how many of the item remain to be collected, and each time an item is picked up, a placeholder icon is replaced by a full color collected icon.
In this recipe, we use grey-filled star icons as the placeholders and yellow-filled star icons to indicate each collected star, as shown in the following screenshot.
Since our UI code is getting a little more complicated, this recipe will implement the MVC design pattern to separate the view code from the core player logic (as introduced at the end of recipe Displaying single object pickups with carrying and not-carrying text).
Getting ready
This recipe assumes that you are starting with the project Simple2Dgame_SpaceGirl
setup from the first recipe in this chapter.