Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small error #12

Open
ERogalla opened this issue May 10, 2020 · 1 comment
Open

Small error #12

ERogalla opened this issue May 10, 2020 · 1 comment

Comments

@ERogalla
Copy link

ERogalla commented May 10, 2020

Hi Tim,

I was going through your code and realized a small formatting error. I don't know if you still keep up with this repo but I though I'd point it out.
In your file "Flappy_bird.py", you wrote this starting on line 368

for pipe in pipes:
    ...
    for bird in birds:
        ...

    if not pipe.passed and pipe.x < bird.x:
        pipe.passed = True
        add_pipe = True

The problem on line 381 is that bird.x cannot be referenced because it is not inside the birds for loop. I do not know if this was meant on purpose or if this error even occurs. I would suggest changing it to

if not pipe.passed and pipe.x < birds[0].x:

Thank you for your time and thanks for the videos!

@ERogalla ERogalla changed the title Unindented code Small error May 10, 2020
@ostap-tymchenko
Copy link

i recommend just making this into a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants