From d16711068a2dc80f4d68e8e650c1cbc0cf71dad9 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Sat, 4 Apr 2020 20:54:11 +0200 Subject: [PATCH] Initial player implementation --- src/entities/Player.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/entities/Player.py b/src/entities/Player.py index 0cc7578..84f9775 100644 --- a/src/entities/Player.py +++ b/src/entities/Player.py @@ -1,6 +1,24 @@ -import src.entities.Entity as Entity +from enum import Enum + +from src.entities.Entity import Entity +from src.entities.Statistics import Statistics +import pygame -class Player(Entity): - def __init__(self): - self.statistics +class Player(Entity, pygame.sprite.Sprite): + def __init__(self, spawnpoint, size): + pygame.sprite.Sprite.__init__(self) + + self.statistics = Statistics(100, 0, 0, 100) + + self.image, self.rect = Entity.getTexture("player.jpg", size) + super(Player, self).__init__(self.image, spawnpoint) + # Where the player is facing, 0 - north, 1 + self.rotation = Rotations.NORTH + + +class Rotations(Enum): + NORTH = 0 + EAST = 1 + SOUTH = 2 + WEST = 3 \ No newline at end of file