diff options
| author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-09-15 17:38:02 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-09-15 17:38:02 -0700 |
| commit | 8ac11eda05e7159a7f762d3396cf7bb8ee51534b (patch) | |
| tree | 6e1214ceebd209f3829aac73b2dd330452079d84 /kennel/engine/entities | |
| parent | f7e7121fce7bd3f7fdabe836955e43b3d194c1c6 (diff) | |
| download | kennel.hatecomputers.club-8ac11eda05e7159a7f762d3396cf7bb8ee51534b.tar.gz kennel.hatecomputers.club-8ac11eda05e7159a7f762d3396cf7bb8ee51534b.zip | |
Diffstat (limited to 'kennel/engine/entities')
| -rw-r--r-- | kennel/engine/entities/cat.py | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/kennel/engine/entities/cat.py b/kennel/engine/entities/cat.py index b5a8c6c..c0acfd8 100644 --- a/kennel/engine/entities/cat.py +++ b/kennel/engine/entities/cat.py @@ -4,7 +4,7 @@ from enum import Enum from .entity import Entity, EntityType -class CatState(Enum): +class CatState(str, Enum): IDLE = "IDLE" FROLICKING = "FROLICKING" EEPY = "EEPY" @@ -13,20 +13,47 @@ class CatState(Enum): CHASING_CAT = "CHASING_CAT" SCRATCHING = "SCRATCHING" ITCHY = "ITCHY" + MAKING_BISCUITS = "MAKING_BISCUITS" + + +class CatSpriteState(str, Enum): + ALERT = "ALERT" + MAKING_BISCUITS = "MAKING_BISCUITS" class Cat(Entity): def __init__(self, id: str, spritesheet_source: str): state_to_spritespec = self.get_state_to_spritespec() components = [ - Position(0, 0), - SpriteSheet(spritesheet_source, state_to_spritespec, CatState.ALERT), + Position(50, 50), + SpriteSheet( + spritesheet_source, state_to_spritespec, CatSpriteState.MAKING_BISCUITS + ), ] super().__init__(EntityType.CAT, id, components) def get_state_to_spritespec(self): - return {CatState.ALERT: SpriteSpec(100, 0, 0, 200, 40, 5)} + creature_width = 32 + creature_height = 32 + return { + CatSpriteState.ALERT: SpriteSpec( + 100, + creature_width * 7, + creature_height * 3, + creature_width * 8, + creature_height * 4, + 1, + ), + CatSpriteState.MAKING_BISCUITS: SpriteSpec( + 300, + 0, + 0, + creature_width, + creature_height * 2, + 2, + ), + } # |
