W
W
Waffle472022-03-16 19:16:21
pygame
Waffle47, 2022-03-16 19:16:21

Pygame how to take from a class (group of items) the corresponding values ​​for another group of items?

I'm doing a flappy bird project and I need to make the pipes move to the left. I had to split the pipes into 2 files (top and bottom). They are randomly generated. How it should work:
The bottom pipe is generated and the top pipe gets the y value of the bottom pipe.
Both pipes move to the left.
But due to the fact that there can be several pipes on the screen, then simply getting from Downtube.py y will not work, because it changes every time.
It is necessary that the lower pipe, according to its own account, take from the group of upper pipes such a value that is located at the upper pipe in the same account. Well, or your suggestions.
flappybird.py - the file itself that needs to be opened to start the game
controls.py - is responsible for updating the whole
ptic.py - the file with the logic of the bird
trub.py - downpipe logic file
uptrub.py - uptube logic file
Link to files:
https://drive.google.com/drive/folders/1Hh9NwJ2yQv...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question