Skip to content Skip to sidebar Skip to footer

Image Move Only When Mouse Move, Why? Python3+pygame

I have a problem and have no idea how explain this bug. I have an image that I want to move, and this is the code: #!/usr/bin/env python # -*- coding: utf-8 -*- import pygame impo

Solution 1:

You are flipping inside your event loop. Which means you are currently updating the screen for every event generated. You don't want that.

Here's a boilerplate.

The gist is you:

for event in events:
    #handle them
draw()
pygame.display.flip()

Post a Comment for "Image Move Only When Mouse Move, Why? Python3+pygame"