Added experience system
This commit is contained in:
		@@ -3,3 +3,15 @@ from ..interfaces import FightingEntity
 | 
			
		||||
class Player(FightingEntity):
 | 
			
		||||
    maxhealth = 20
 | 
			
		||||
    strength = 5
 | 
			
		||||
 | 
			
		||||
    currentXP: int
 | 
			
		||||
    maxXP: int
 | 
			
		||||
 | 
			
		||||
    def level_up(self):
 | 
			
		||||
        if currentXP>maxXP :
 | 
			
		||||
            self.level+=1
 | 
			
		||||
            currentXP = 0
 | 
			
		||||
            maxXP = self.level*10
 | 
			
		||||
    def addXP(self, xp) :
 | 
			
		||||
        currentXP+=xp
 | 
			
		||||
        self.level_up()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user