When interacting with loot, add gold to players gold.
Maybe instead of a gold number also create a basic inventory list. The valuables in this list are added together at level end, spelunky style. It is a little more satisfying.
Maybe also build a foundation for interacting with other various objects (e.g. doors) here too.
[x] maybe try to avoid inheritance of classes (interface inheritance ok), try something like Collectible extends IInteractible
followup for #3 where
Collectible
was addedWhen interacting with loot, add gold to players gold.
Maybe instead of a gold number also create a basic inventory list. The valuables in this list are added together at level end, spelunky style. It is a little more satisfying.
Maybe also build a foundation for interacting with other various objects (e.g. doors) here too.
Collectible
extendsIInteractible
IInteractionEntity.GetInteractionEntity
which is passed intoIInteractible.GotInteractedBy(IInteractionEntity)
IInteractionEntities
(such as player, enemy, even spells) fromIInteractible
s, such as doors and objects