PolyMarsDev / Flappuccino

A Pygame game made in 48 hours
354 stars 127 forks source link

Error #32

Closed Snaky4life closed 1 year ago

Snaky4life commented 2 years ago

Hey, so when I run the project, I receive this error PS C:\Users\orlan\OneDrive\Desktop\Flappuccino-main> & C:/Users/orlan/AppData/Local/Programs/Python/Python310/python.exe c:/Users/orlan/OneDrive/Desktop/Flappuccino-main/main.py pygame 2.1.2 (SDL 2.0.18, Python 3.10.5) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "c:\Users\orlan\OneDrive\Desktop\Flappuccino-main\main.py", line 277, in <module> main() File "c:\Users\orlan\OneDrive\Desktop\Flappuccino-main\main.py", line 17, in main pygame.display.set_icon(bean().sprite) UnboundLocalError: local variable 'bean' referenced before assignment

Xyc330 commented 2 years ago

I checked the code and on line 17, it's supposed to be pygame.display.set_icon(Bean().sprite) instead of pygame.display.set_icon(bean().sprite). The B is upper case because you're using the Bean class.

So change the "bean()" to "Bean()" and it should work 🙂.

JanPoonthong commented 2 years ago

You can check my pull request, I fix the bug https://github.com/PolyMarsDev/Flappuccino/pull/16