Advertisement
jabela

Pygame Magic 8 Ball

Dec 18th, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. import pygame
  2. import random
  3. pygame.init()
  4. pygame.display.set_caption('Magic 8 ball')
  5. window = pygame.display.set_mode((300, 100))
  6. replies = ['Signs point to yes',
  7.         'Without a doubt',
  8.         'You may rely on it',
  9.         'Do not count on it',
  10.         'Looking good',
  11.         'Cannot predict now',
  12.         'It is decidedly so',
  13.         'Outlook not so good']
  14. running = True
  15. #Write Text
  16. def fontprint():
  17.     font=pygame.font.Font(None,32)
  18.     text1=font.render(random.choice(replies), 1, (255,255,255))
  19.     window.blit(text1, (50, 50))
  20.     return
  21. fontprint()
  22. while running:
  23.     for event in pygame.event.get():
  24.         pygame.display.update()
  25.         if event.type == pygame.QUIT:
  26.             running = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement