Skip to content

Interface. Food Inventory

Mr. Fat Guy edited this page Apr 9, 2024 · 11 revisions

Table of Contents:

Table of contents generated with markdown-toc.

General

You can carry:

  • 10 food items along with you
  • And +10 items extra for every donkey that you purchase at the stable.

So, up to 40 food items at most (when having three donkeys) in 10x4 matrix:

Food Inventory

Internal Array

Implemented in: #125.

Example

The representation of the above example food inventory, using our internal products IDs would look like that:

P 28 29 29 4 3 10
D 11 1 2 3 9 5 6 4
D 31 4 9 31 9 8 4 7 6
D 29 29 29 29 29 29 29 29 29 29

Construction

Each array's item has corresponding item's ID or null value and it does not denote quantity. For food (on contrary to tools) game does not implement items' quantities.

So, the above table or inventory "translated" into Javascript array could look something like that:

let food = [
    [28, 29, 29, null, null, null, null, 4, 3, 10],
    [1, null, null, 1, 2, 3, 9, 5, 6, 4],
    [31, 4, 9, null, 31, 9, 8, 4, 7, 6],
    [29, 29, 29, 29, 29, 29, 29, 29, 29, 29]
];

Two-dimensional array is suggested, to make it easier to implement functionality, where player can move items between its own pocket and donkeys that he has purchased (as in graphical example above).

Meaning of the IDs can be found among shop goods and extra items.

Initial values

Player starts a new game with a completely empty Food Inventory meaning that all 28 array items are set to null.

Home

Game

Town

Locations

Gameplay

Development

Clone this wiki locally