Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit 062a4591a0a16ae1e3f868778971fd93a33e0daf
parent 25261b72ae1bd12bcf18856d0cd014738033100a
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed, 19 Aug 2020 10:35:54 -0500

entity class

Diffstat:
Asrc/entity.py | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/entity.py b/src/entity.py @@ -0,0 +1,22 @@ +import pygame + +class Entity(pygame.sprite.Sprite): + """ + Extended sprite class used throughout game. + """ + + def __init__(self, image, pos): + + pygame.sprite.Sprite.__init__(self) + + self.image = image + self.rect = self.image.get_rect() + self.rect.topleft = pos + + def act(self): + pass + + def update(self, surface = None): + + if surface != None: + surface.blit(self.image, self.rect)