Designing Items
Hands-on Rust — by Herbert Wolverson (92 / 120)
👈 Chapter 13 Inventory and Power-Ups | TOC | Managing Inventory 👉
Item design is fun. You probably have some ideas for the items you want to include in your game. Taken alongside Chapter 15, Combat Systems and Loot, this chapter will give you the experience you need to add items to your game and build a unique experience.
Here, you’re going to add two items: Healing Potions and Dungeon Maps. Healing potions restore the player’s hit points, and dungeon maps reveal the entire map, allowing the player to carefully plan a route to the Amulet of Yala. The graphics for these items are included in the dungeonfont.png file.
Let’s start by giving the new items some component definitions.
Describing the Items with Components
You already have most of the components you need to describe the healing potion and dungeon map items — they need a name, appearance, and position on the map, which means you can re-use the following existing components:
- Item: Potion or Scroll
- Name: The name that appears in tooltips and the player’s inventory list
- Point: The item’s position on the map
- Render: The visual display component for the item
You also need new component types to describe what each item does.