Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # Blink.py is a PyGame program that makes B-MO's face blink, using simple graphics and images.
- # Import the PyGame and system files to use
- import pygame
- import sys
- import random # Importing random allows me to make blinks happen on a random interval
- from pygame.locals import *
- # Initilize Pygame and set the clock speed (Set to 30fps)
- pygame.init()
- FPS = 30
- fpsClock = pygame.time.Clock()
- # Set the display size (should always be 720x480)
- DISPLAYSURF = pygame.display.set_mode((720 480))
- # Set-up the colours that will be used
- BLACK = ( 0, 0, 0)
- WHITE = (255, 255, 255)
- BMOBLUE = (222, 255, 239)
- # Load and set any variables for images we have
- blinkImg = pygame.image.load('blink.png')
- # Set the title of the window
- pygame.display.set_caption('B-MO Blink!')
- # Draw the surface objects
- DISPLAYSURF.fill(BMOBLUE)
- DISPLAYSURF.blit(blinkImg, (32, 32))
- while True: # Main loop
- # for event in pygame.event.get():
- if event.type == QUIT:
- pygame.quit()
- sys.exit()
- # Update the display to draw the new things we put in
- pygame.display.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement