Skip to content

Create the player class

Is your feature related to a problem? Please describe.

To play through a story and interact with it, the user has to be represented by a player object. This player object should keep track of the users possessions. The health of a player should never be lower than 0.

Describe the solution you'd like.

The image below describes the proposed implementation. The inventory is at the moment only a list of strings. Additionally a isDead method should check if the users health is lower than 0. The setHealth method should make sure the health is never lower than 0.

image