Advertisement
Redomine

Untitled

Sep 17th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. class screen_updates:
  2. def __init__(self):
  3. self.w = 600
  4. self.l = 600
  5. self.passages = 10
  6. self.passage_wight = 60
  7. self.update_coordinats = 'true'
  8. self.font = pygame.font.Font('BebasNeue-Regular.ttf', 25)
  9. self.FPS = 60
  10. self.menu_sound = pygame.mixer.Sound('main_theme.ogg')
  11. self.white = (255, 255, 255)
  12. self.menu_image = pygame.image.load('Sprites/main_menu.png')
  13. self.screen = pygame.display.set_mode((self.w, self.l))
  14. def main_menu(self, status):
  15. clock = pygame.time.Clock()
  16. text = \
  17. self.font.render('Hello My Dear Friend! To play press "Space"!',
  18. True, self.white)
  19. while status != 'off':
  20. self.menu_sound.play()
  21. clock.tick(self.FPS)
  22. pygame.display.update()
  23. self.screen.blit(self.menu_image, (0, 0))
  24. self.screen.blit(text, [100, 450])
  25. for event in pygame.event.get():
  26. if event.type == pygame.KEYDOWN:
  27. if event.key == pygame.K_SPACE:
  28. status = 'off'
  29. self.menu_sound.stop()
  30. pygame.mixer.music.play(-1)
  31. return status
  32. def move(self, current_move_direction, x, y, sortament_of_dicks):
  33. if self.update_coordinats == 'true':
  34. (x, y) = step(current_move_direction, self.passage_wight, x, y)
  35. self.update_coordinats = 'false'
  36. del sortament_of_dicks[0]
  37. sortament_of_dicks.append([x, y])
  38. return sortament_of_dicks
  39.  
  40. def face_click(morgan, open_mouth, closed_mouth):
  41. if self.update_coordinats == 'true':
  42. if morgan == open_mouth:
  43. morgan = closed_mouth
  44. else:
  45. morgan = open_mouth
  46. return morgan
  47.  
  48.  
  49. def main():
  50. sortamen_of_dicks = snake.move(current_move_direction, x, y, sortament_of_dicks)
  51. morgan = screen_updates.face_click(morgan, open_mouth, closed_mouth)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement