I currently experiencing an issue in pygame where whenever i increase the number of objects e.g. platforms, rocks
for a in range(150): rock = Rock(0,0)
OR incresing the range which they spawn in:
rock.rect.x = random.randrange(-200,30000) rock.rect.y = random.randrange(80,500) rock_list.add(rock) all_sprites_list.add(rock)
(which i really need to do for an ENDLESS mode) collision detection between the player and all the objects that have have been changed will become less frequent, so the character will just go through th objects as they weren't even there... you can see the character fall through the objects, it falls through in front of the object and not behind. All game code is below, I have tried a number of different techniques and values but I have found that these numbers and ranges work best.
Collision Detection code: FOR PLATFORM
medium_collide = pygame.sprite.spritecollide(player, medium_list, False) if medium_collide: player.rect.y-=2
rock_collide = pygame.sprite.spritecollide(player, rock_list, True) if rock_collide: lives-=1 if rock_collide: player.rect.y = 100 player.rect.x = 50
!!!!!GAME CODE BELOW!!!!!