Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Any pygame users?  (Read 784 times)

0 Members and 1 Guest are viewing this topic.


Any pygame users?
« on: March 13, 2013, 11:23:56 pm »
  • fishy cakes~
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 43
I have a problem in the pong game I am developing using the pygame module (written in python).  My problem is the paddle (mouse) won't show up, it's just blank.  If you need further input about my code at all, feel free to ask.

Code: [Select]
import pygame
from pong import Pong
from pygame.locals import *

# Create an instance
game = Pong()

# Initalize the game
screen = pygame.display.set_mode((900,600),0,32)
screen.blit(screen, (0,0))
pygame.mouse.set_visible(False)     # Hide mr. mouse
beeper = pygame.image.load('paddle.png')     # Paddle
bpaddle = pygame.image.load('blank_paddle.png')     # Paddle that is drawn over the green one to ensure "motion"

paddle_rect = beeper.get_rect()
blank_rect = bpaddle.get_rect()
bounds_rect = pygame.Rect(0, 0, 300, 300)
paddle_pos = (0,0)

while True:
     for event in pygame.event.get():
          if event.type == QUIT:

     paddle_pos = pygame.mouse.get_pos()
     paddle_rect.center = pygame.mouse.get_pos()
     screen.blit(beeper, paddle_rect)
     pygame.draw.line(screen, game.lineColor, game.net1, game.net2, game.netWidth)
     screen.blit(bpaddle, paddle_rect)
  • Personal Blog
Pages: [1]   Go Up


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved

Page created in 0.061 seconds with 24 queries.