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 2515 times)

0 Members and 1 Guest are viewing this topic.

Alex

kittens!
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]
#!/usr/bin/python
import pygame
from pong import Pong
from pygame.locals import *

# Create an instance
game = Pong()

# Initalize the game
pygame.init()
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:
               sys.exit()

     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)
     pygame.display.update()
Logged
  • Personal Blog
Pages: [1]   Go Up

 


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



Page created in 0.409 seconds with 39 queries.