You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

5 years ago
import pygame
class Bongocat:
bongocat_plain = None
left_paw_lifted = None
left_paw_down = None
right_paw_lifted = None
right_paw_down = None
rect = None
is_left_paw_pressing = False
is_right_paw_pressing = False
def load(self):
self.bongocat_plain = pygame.image.load("img/bongocat_plain.png")
self.left_paw_lifted = pygame.image.load("img/left_paw_lifted.png")
self.left_paw_down = pygame.image.load("img/left_paw_down.png")
self.right_paw_lifted = pygame.image.load("img/right_paw_lifted.png")
self.right_paw_down = pygame.image.load("img/right_paw_down.png")
self.rect = self.bongocat_plain.get_rect()
def draw(self, screen):
screen.blit(self.bongocat_plain, self.rect)
if self.is_left_paw_pressing:
screen.blit(self.left_paw_down, self.rect)
screen.blit(self.left_paw_lifted, self.rect)
if self.is_right_paw_pressing:
screen.blit(self.right_paw_down, self.rect)
screen.blit(self.right_paw_lifted, self.rect)
def left_paw_pressing(self, pressing):
self.is_left_paw_pressing = pressing
def right_paw_pressing(self, pressing):
self.is_right_paw_pressing = pressing