PGU Tiles collision detection

Posted by user280454 on Stack Overflow See other posts from Stack Overflow or by user280454
Published on 2010-04-10T01:05:31Z Indexed on 2010/04/10 1:13 UTC
Read the original article Hit count: 392

Filed under:
|

Hi, I've been using PGU(Phil's Pygame Utilities) for a while. It has a dictionary called tdata, which is passed as an argument while loading tiles

tdata = { tileno:(agroup, hit_handler, config)}

I'm making a pacman clone in which I have 2 groups : player and ghost, for which I want to collision detection with the same type of tile.

For example, if the tile no is 2, I want this tile to have agroups as both player and ghost. I tried doing the following:

tdata = {0x02 :('player', tile_hit_1, config), 0x02 : ('ghost', tile_hit_2, config)}

However, on doing this, it only gives collision detection for ghost, not the player.

Any ideas on how I can do collision detection for both the player and the ghost with the same type of tile?

© Stack Overflow or respective owner

Related posts about python

Related posts about pygame