lbehr19 / hello-world

My code portfolio
0 stars 0 forks source link

Improvement: add treasure #16

Open lbehr19 opened 5 years ago

lbehr19 commented 5 years ago

Make it so that when an enemy dies, they drop a random amount (1-5) of 'gold'; as player moves over it, they pick up the gold (there should be a display to show how much they have, separate from the score). When picked up, gold does not affect player's score. At the end of the level, they receive bonus points for the amount of gold they had left - 1 point per 1 unit of gold.

At some point, if I add equipment or something like that, this would be used as currency, to potentially be used at a shop. For now, though, it should just provide a new incentive for killing monsters and such.

lbehr19 commented 5 years ago

Made new class (Coin) to keep track of where coins are on the map. This also handles drawing the image. The class has functions attached for when enemies drop coins and when the player picks up a coin.

Still not done: I don't have a way of varying the value of coins; all coins are worth one gold. Additionally, coin effect on the player's score is not implemented, nor do I have the player's amount of gold showing up on the screen.