Skip to content

[lab-data-vikings] Guillermo Martínez#125

Open
guillermomar wants to merge 1 commit intoironhack-datalabs:masterfrom
guillermomar:vikings
Open

[lab-data-vikings] Guillermo Martínez#125
guillermomar wants to merge 1 commit intoironhack-datalabs:masterfrom
guillermomar:vikings

Conversation

@guillermomar
Copy link
Copy Markdown

commit lab-vikings that also includes the bonus with a battle game with armies

@Clapiniella
Copy link
Copy Markdown

Morning in da morning!

Tu ejercicio de los vikingos está ESPECTACULAR. Muy bien hecho!!! Solo como mejora te comentaría que en vez de hacer esto para el método receiveDamage:

 def receiveDamage(self, damage):
        self.health -= damage
        if self.health > 0:
            return self.name + " has received " + str(damage) + " points of damage"
        else:
            return self.name + " has died in act of combat"

Recuerda que si puede heredar de otras clases, entonces que herede aunque luego hagas modificaciones.

 def receiveDamage(self, damage): 
        super().receiveDamage(damage)
        if self.health > 0: 
            return self.name + " has received " + str(damage) + " points of damage"
        else:
            return self.name + " has died in act of combat"

Este quizás no es el mejor ejemplo, pero hay que acostumbrarse a reutilizar código.

Por lo demás, genial!! Y por cierto, han ganado los Saxons en mi batalla..

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants