Pygame mouse cursor load/unload

Alex Gardner agardner210 at gmail.com
Sun Mar 3 17:09:52 EST 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 that I'm dealing with.  I want to restrict the paddle to a certain plane.  When the paddle reaches the boundary, it locks up.  I am using the code that Ian provided earlier (thank you so much).  Here is what I have so far:

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

I tried making an else statement and copying Ian's code in it, but I don't think that it would work.  I have tried to fix this myself; this is my second GUI program that I have ever made.... please forgive me if I seem needy. 



More information about the Python-list mailing list