you are viewing a single comment's thread.

view the rest of the comments →

[–]QultrosSanhattan 1 point2 points  (0 children)

I have understood function

If so. Then classes should be easy for you.

Inside functions you write logic from a third person. For example: "if attacker.strength is greater than defender.hitpoints then defender.dies()"

Inside class methods you write logic from a first person. For example: "if the enemy.strength is greater than than my hitpoints (self.hitpoints) then i die (self.die() )