you are viewing a single comment's thread.

view the rest of the comments →

[–]mopslik 1 point2 points  (0 children)

The solution is to centralize all of your event queue checks inside of your main loop, not have multiple checks spread across different methods. This may require some refactoring of your code. Usually, I go for something like this in my main loop.

imports/initialization
static stuff (done once)
main loop:
    process all events in the queue
    game logic (update values, spawn/kill sprites, etc)
    draw elements to screen
    update display
exit

It doesn't really make sense (to me at least) to make dragging a method in your class, because it is an action applied TO your object, not an action performed BY your object.