Graphic icons are an effective way to inform the player that they are carrying an item. In this recipe, if no star is being carried, a gray-filled icon in a blocked-off circle is displayed in the top-left of the screen:
Then, after a star has been picked up, a yellow-filled star icon is displayed. In many cases, icons are clearer (they don't require reading and thinking about) and can also be smaller onscreen than text messages that indicate player status and inventory items.
This recipe also illustrates the benefits of the MVC design pattern described in the previous recipe – we are changing how to communicate to the user (using the View via icons rather than text), but we can use, with no changes required, script class PlayerInventory (the Model-Controller), which detects player-star collisions...