Going further

If you are adventurous, try expanding your project to add the following features:

  • Add the inventory menu to the battle scene, as previously discussed.
  • Use a scroll bar to allow the inventory menu and shop inventory to exceed the current view.
  • Group similar inventory items together by showing a single image with an item count.
  • Add scripts to the inventory items to allow them to affect the player's health.
  • Have a go at adding money into the equation by making things cost money. In the purchasing section, display and act on it if the player does not have enough.
  • Put a second view in the shop to allow the player to sell items back to the shop.

Get Mastering Unity 2D Game Development - Second Edition 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.