How do I make a collision in pygame with 2 images? [duplicate]

Solution 1:

self.rect_img is the rect of the last grass tile that you set by going through the for loops in tile function. So,

self.rect_img.colliderect(self.player_rect):

is actually only testing the last grass tile.

You need to test against all the tiles, not just the last one. Luckily, you are storing those tiles in a list, so you can go through that list can check against player and all the tiles.

 for t in self.tile_list:
      if t[1].colliderect(self.player_rect): #COLLISIONS DONT WORK
            print("collided")

Also, you code could be faster if you load and transform your images once instead of every frame.