Chapter 13 Inventory and Power-Ups

Hands-on Rust — by Herbert Wolverson (91 / 120)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Wrap-Up | TOC | Designing Items 👉

Badly wounded by the goblin, the hero reaches into their backpack. Uncorking a terrible smelling potion and drinking it, their wounds close. Refreshed, the hero is ready to return to the good fight.

This scene is a staple of modern fantasy games: the adventurer finds an item on the map, stores it in their inventory, and then uses it later when needed. Substitute the smelly potion for a healing system controlled by sympathetic nanobots, and you have a similar game mechanic for a sci-fi game.

With items and inventory systems, you can add variety to your game. Players can now make tactical decisions based on item use — they’ll need to consider whether it’s worth the potential injuries to reach an item despite the number of monsters who might be guarding it.

However, before you can offer items for pickup, you first need to design and create them.

👈 Wrap-Up | TOC | Designing Items 👉

Hands-on Rust by Herbert Wolverson can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.