Hi there I am currently working on a side on-platformer. I am experiencing a weird issue when I jump from one platform and to another it works fine. However whenever I jump from one and hit the bottom of another one my character sprite goes flying off the screen upwards. I feel that this is due to not having correctly programmed the collision between the player and the platforms, because I don't know how. Heres what ive done at the moment:
collide = pygame.sprite.spritecollide(player, platform_list, False)
if collide:
player.rect.y-=1
If anyone can suggest a better way for collision detection between player and platforms please say it, thanks. And somehow this bug allows the player to get past the screen boundaries which I've set up for the 4 corners of the screen (lines 322 and 212), however these barriers normally
Heres my full game code: