[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Help - Events



Hi!

I am making a game in wich the player has to fill an area with tiles. It's an educational game. But I got a problem with pygame events... Actually I think it's a simple problem, but I don't know how to solve.

There are two functionalities for the left click of the mouse: the first is to put a tile in the area, when dragging one tile, and the other is to remove one tile of the area (when not dragging). The problem is that, when I put both codes together, the two things happen at the same time - it puts the tile and then removes it. I've tried to block the removal of the tile setting a variable, "placed", which blocks the action of removing the tile until the next event handling. But it didn't work.

Can someone help me solve this?

Thanks in advance,
--
Thiago Henrique Petruccelli