Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import random
- pygame.init()
- pygame.display.set_caption('Magic 8 ball')
- window = pygame.display.set_mode((300, 100))
- replies = ['Signs point to yes',
- 'Without a doubt',
- 'You may rely on it',
- 'Do not count on it',
- 'Looking good',
- 'Cannot predict now',
- 'It is decidedly so',
- 'Outlook not so good']
- running = True
- #Write Text
- def fontprint():
- font=pygame.font.Font(None,32)
- text1=font.render(random.choice(replies), 1, (255,255,255))
- window.blit(text1, (50, 50))
- return
- fontprint()
- while running:
- for event in pygame.event.get():
- pygame.display.update()
- if event.type == pygame.QUIT:
- running = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement