Adding Power After Receiving Inventory
Learn how to manage power after receiving a dungeon map and healing potion.
Sending an item-activation message
In Sending Messages of Intent, we adopted a pattern in which systems indicate their intent to perform an action and the actual action is handled in its own system. Using an item is no different. Decoupling intent and activation in this way allows our code to remain flexible. If we decide that a tough monster should be able to use magical items, we only need to send the message of intent without duplicating the effect code.
Add a new component named ActivateItem
in components.rs
:
Get hands-on with 1400+ tech skills courses.