Week 6
18: Adding an inventory system
Add inventory panel
- Add it to interface layer
- Open chat box script, click menu, export, select all, copy, close script
- Add script to inventory panel, menu, import, paste
- Change textfield text to “INVENTORY”
- Replace “when I receive message” with “When key I pressed” and remove “Set text”
- Play game

Repositioning inventory Change offsets

19: Items in the inventory
Disabling inventory with i key
- Add “if else”, if visibility = false, do activate blocks, else do deactivate blocks

Adding health potion icon to inventory
- Place new health potion next to inventory panel
- Add script, when level starts, disable physics, add tag “health potion icon”

- Edit inventory script
- Add set instance health potion icon to first instance tag health potion icon

- Duplicate set x and y position blocks for health potion icon positioning constantly

- Play game to see how it’s positioned

- Error! Because “when level starts, find health potion tag” is happening before “add tag”.
- On health potion icon, replace when level starts with when created

- Play game again
20: Inventory item text
Functions for visibility instead
- Put them in functions
- Add visibility for health potion icon

Textfield for item count
- Copy paste the same blocks for the first textfield with some tweaks
- Change textfield by creating new var called textfield health potion count
- Set number health potions to 0



- Constantly position the count textfield

⚡ Bonus Activities ⚡
Bonus 8.1: Uploading your own images