Esempio n. 1
0
    def __init__(self):
        MovingObject.__init__(self)

        # VISUAL PARAMETERS #
        self.width = 40
        self.height = 60
        self.image = pygame.Surface([self.width, self.height])
        self.image.fill(Colors.RED)


        # POSITION AND BOUNDING BOX PARAMETERS #
        self.rect = self.image.get_rect()

        # MOVEMENTS PARAMETERS #
        self.direction = None

        self.speed_x = 6   # 6 pixels per tick
        self.speed_y = 10  # Jumping
        self.velocity_x = 0  # Negative means move left, positive means move right
        self.velocity_y = 0  # Negative means move up, positive means move down

        self.isGrounded = False


        # WEAPONS PARAMETERS #
        self.weapon = Gun()
        self.weapon.shootingDelay = 0 # No delay for the player

        # POINTS #
        self.hp = 100
        self.isDead = False
Esempio n. 2
0
    def __init__(self, player):
        #pygame.sprite.Sprite.__init__(self)
        MovingObject.__init__(self)

        # MOVEMENT PARAMETERS
        self.speed_x = 2 # 6 pixels per tick


        self.width = 40
        self.height = 60
        self.image = pygame.Surface([self.width, self.height])
        self.image.fill(Colors.BLACK)

        #Bounding box
        self.rect = self.image.get_rect()

        # SHOOTING
        self.weapon = Gun()


        self.hp = 100
Esempio n. 3
0
 def update(self, walls):
     MovingObject.update(self, walls)