We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb8a488 commit 60a9b54Copy full SHA for 60a9b54
app.py
@@ -44,6 +44,15 @@ def add_xp(self, amount: float) -> None: # add XP
44
Add XP (experience points) to the user.
45
amount - the amount to add XP.
46
"""
47
+ if (
48
+ amount == self.last_item_clicked
49
+ ): # check if amount is the same as last item clicked
50
+ self.multiplier += 1 # increase multiplier
51
+ else:
52
+ self.multiplier = (
53
+ 1 # reset multiplier if amount is not the same as last item clicked
54
+ )
55
+ self.last_item_clicked = amount # set last item clicked to amount
56
self.xp += amount * self.multiplier # add XP by amount
57
self.total_xp += amount * self.multiplier # add total XP by amount
58
self.check_level_up() # check if user has leveled up
0 commit comments