Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class screen_updates:
- def __init__(self):
- self.w = 600
- self.l = 600
- self.passages = 10
- self.passage_wight = 60
- self.update_coordinats = 'true'
- self.font = pygame.font.Font('BebasNeue-Regular.ttf', 25)
- self.FPS = 60
- self.menu_sound = pygame.mixer.Sound('main_theme.ogg')
- self.white = (255, 255, 255)
- self.menu_image = pygame.image.load('Sprites/main_menu.png')
- self.screen = pygame.display.set_mode((self.w, self.l))
- def main_menu(self, status):
- clock = pygame.time.Clock()
- text = \
- self.font.render('Hello My Dear Friend! To play press "Space"!',
- True, self.white)
- while status != 'off':
- self.menu_sound.play()
- clock.tick(self.FPS)
- pygame.display.update()
- self.screen.blit(self.menu_image, (0, 0))
- self.screen.blit(text, [100, 450])
- for event in pygame.event.get():
- if event.type == pygame.KEYDOWN:
- if event.key == pygame.K_SPACE:
- status = 'off'
- self.menu_sound.stop()
- pygame.mixer.music.play(-1)
- return status
- def move(self, current_move_direction, x, y, sortament_of_dicks):
- if self.update_coordinats == 'true':
- (x, y) = step(current_move_direction, self.passage_wight, x, y)
- self.update_coordinats = 'false'
- del sortament_of_dicks[0]
- sortament_of_dicks.append([x, y])
- return sortament_of_dicks
- def face_click(morgan, open_mouth, closed_mouth):
- if self.update_coordinats == 'true':
- if morgan == open_mouth:
- morgan = closed_mouth
- else:
- morgan = open_mouth
- return morgan
- def main():
- sortamen_of_dicks = snake.move(current_move_direction, x, y, sortament_of_dicks)
- morgan = screen_updates.face_click(morgan, open_mouth, closed_mouth)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement