Creating a shop and inventory

As with other areas in this book, we will just keep things simple when implementing the sample project. You can always extend or replace it later if you wish.

We will also look at two slightly different approaches: using a scene for the shop and a layer system for the inventory.

Gathering shop assets

The shop will contain various healing items for the player to purchase. To create the shop, we'll just create a new scene to keep things simple as we expect to enter a shop and leave it when we are done.

I altered the assets I used to make the HUD for the battle system to create a new menu that will be used for the shop. I also added a talk bubble, which we will use for the shopkeep to speak to us and show us what we are ...

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.