Apr-25-2020, 01:18 PM
Hello,
I recently started programming with Python and I started making a Doodle Jump game with PyGame.
I used a simple method to identify the collision between the character and the platform.
However, this collision isn't always identified with a platform moving up and down (horizontally).
Any ideas how to make it 100% work?
Here is my code for the character:
I recently started programming with Python and I started making a Doodle Jump game with PyGame.
I used a simple method to identify the collision between the character and the platform.
However, this collision isn't always identified with a platform moving up and down (horizontally).
Any ideas how to make it 100% work?
Here is my code for the character:
characterJump = 300 if characterJump < 150: positionCharacterY += 2 if rightFootCharacter[1] == height: characterJump = 300 for i in range(160): #Test if platform and character collide if (rightFootCharacter[0] == (platformMatrix[0][i] + imagePlateform1x)) and (rightFootCharacter[1] == imagePlateform1y): characterJump = 300 characterJump -= 1And this is my code for the platform:
platformUp = 400 if platformUp < 200: imagePlateform1y -= 2 if platformUp == 0: platformUp = 400 if platformUp > 200: imagePlateform1y += 2 platformUp -= 2Thanks for the ideas
