Skip to content

Inventory

clocks-in-a-cooler edited this page Sep 3, 2018 · 2 revisions

Inventory—inventory_panel_manager.js

for other parts of the game, such as event handling, see Game Engine.

The inventory is both a collection of the player's items and the panel that displays that collection.

Functions:

  • add_item() to add a number of the same item. If you want to add 3 meats, then write add_item('meat', 3);. To remove some items, simply use a negative number. For example, add_item('meat', -10); removes 10 meats.

  • remove_all() to remove all of an item from the inventory. For example, remove_item('meat'); removes all meat from the inventory.

  • clear_inventory() to clear the entire inventory.

Clone this wiki locally