Pygame mouse cursor load/unload

Alex Gardner agardner210 at gmail.com
Sun Mar 3 23:04:07 CET 2013


On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote:
> I am in the process of making a pong game in python using the pygame library.  My current problem is that when I move the mouse, it turns off as soon as the mouse stops moving.  The way I am doing this is by making the default cursor invisible and using .png files as replacements for the cursor.  Perhaps my code would best explain my problem.  I will take help in any way that I can.  Here are the links that contain my code:
> 
> 
> 
> Main class:  http://pastebin.com/HSQzX6h2
> 
> Main file (where the problem lies):  http://pastebin.com/67p97RsJ
> 
> 
> 
> If the links yield nothing, please let me know (agardner210 at gmail.com)

I have a new problem :(.  I want to restrict the paddle to a certain plane.  I have it working but when the paddle reaches the limit it locks up.  I have no idea how I can redraw it back in the plane.  I am using the code that Ian provided (thank you so much).  I was thinking of making an else to redraw the paddle using the same code, but part of me thinks that it would be rather sloppy.

    if (0,0) <= paddle_pos <= (300,300):
         paddle_pos = pygame.mouse.get_pos() 
         screen.blit(beeper, paddle_pos)
         pygame.display.update()
         clock.tick(50)



More information about the Python-list mailing list