Closed Pawtang closed 5 years ago
player.items = [sword,shield,potion,potion]
UI: Potions: 2
add permanent stat boost when item is in inventory:
something like this:
swordCount = () => { for (i=0; i<player.items.length; i++) if (player.items.name[i] == 'sword' { swordCount++; } }
player.attack += (10*swordCount);
similar for all other stats
can we handle potions in the same way? sure we can, and we should.
player.items = [sword,shield,potion,potion]
UI: Potions: 2
add permanent stat boost when item is in inventory:
something like this:
player.attack += (10*swordCount);
similar for all other stats
can we handle potions in the same way? sure we can, and we should.