Created
December 28, 2015 05:36
-
-
Save dstoza/274f7eeee22db3f2e41a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Creature: | |
def __init__(self, name, hp): | |
self.name = name | |
self.hp = hp | |
class Monster(Creature): | |
def __init__(self, name, hp, attrs): | |
Creature.__init__(self, name, hp) | |
self.int = 10 | |
if 'int' in attrs: | |
self.int = attrs['int'] | |
kobold_attrs = {'int': 6} | |
kobold = Monster('Kobold', 10, kobold_attrs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment