Using pygame.Surface.blit inside class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jakov314
    New Member
    • Mar 2014
    • 2

    Using pygame.Surface.blit inside class

    I can call my class only one time.
    My code is:

    Code:
    class fish:
        def __init__(self, x, y, image, speed):
            self.x = x
            self.y = y
            self.image = image
            self.speed = speed
        def be(self):
            screen.blit(self.image, (self.x, self.y))
            self.x -= self.speed
            if boot.x+36 > self.x and boot.x < self.x+5:
                if boot.y+34 > self.y and boot.y < self.y+5:
                    boot.live -= 1
                    boot.x = 100
                    boot.y = 460
    fishes = []
    fishes.append(f ish(900, 300, fish_1, 1))
    And when I call 'fish' object inside or outside the game loop(
    Code:
    fishes.append(fish(900, 300, fish_1, 1)
    ) I got Error:

    Code:
    TypeError: 'fish' object is not callable
Working...