Advertisement
Guest User

Untitled

a guest
Mar 12th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. #!/usr/bin/python
  2. import pygame
  3. from pong import Pong
  4. from pygame.locals import *
  5.  
  6. # Create an instance
  7. game = Pong()
  8.  
  9. # Initalize the game
  10. pygame.init()
  11. screen = pygame.display.set_mode((900,600),0,32)
  12. screen.blit(screen, (0,0))
  13.  
  14. pygame.mouse.set_visible(False)     # Hide mr. mouse
  15. beeper = pygame.image.load('paddle.png')     # Paddle
  16. bpaddle = pygame.image.load('blank_paddle.png')     # Paddle that is drawn over the green one to ensure "motion"
  17.  
  18. paddle_rect = beeper.get_rect()
  19. blank_rect = bpaddle.get_rect()
  20. bounds_rect = pygame.Rect(0, 0, 300, 300)
  21. paddle_pos = (0,0)
  22.  
  23. while True:
  24.      for event in pygame.event.get():
  25.           if event.type == QUIT:
  26.                sys.exit()
  27.  
  28.      paddle_pos = pygame.mouse.get_pos()
  29.      paddle_rect.center = pygame.mouse.get_pos()
  30.      screen.blit(beeper, paddle_rect)
  31.      pygame.draw.line(screen, game.lineColor, game.net1, game.net2, game.netWidth)
  32.      screen.blit(bpaddle, paddle_rect)
  33.      pygame.display.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement