PolyMarsDev / Flappuccino

A Pygame game made in 48 hours
355 stars 123 forks source link

NameError: name 'colorsys' is not defined #9

Closed shokifrend007 closed 3 years ago

shokifrend007 commented 3 years ago

I removed the "." before the imports and now this happens:

$ python3 main.py pygame 2.0.0 (SDL 2.0.12, python 3.8.5) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "main.py", line 277, in <module> main() File "main.py", line 161, in main o.setSprite(((player.position.y/50) % 100) / 100) File "/home/shokifrend77/Downloads/flappuchino/Flappuccino-main/background.py", line 9, in setSprite color = colorsys.hsv_to_rgb(tint,1,1) NameError: name 'colorsys' is not defined

Thanks in advance!

ghost commented 3 years ago

I removed the "." before the imports and now this happens:

$ python3 main.py pygame 2.0.0 (SDL 2.0.12, python 3.8.5) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "main.py", line 277, in <module> main() File "main.py", line 161, in main o.setSprite(((player.position.y/50) % 100) / 100) File "/home/shokifrend77/Downloads/flappuchino/Flappuccino-main/background.py", line 9, in setSprite color = colorsys.hsv_to_rgb(tint,1,1) NameError: name 'colorsys' is not defined

Thanks in advance!

So inside main.py add 1 line called:

import colorsys

In my pull request I may have not seen this

shokifrend007 commented 3 years ago

I FIxed It!

It's not the main.py that is missing the "import colorsys", it's missing in the "background.py" file.

Thank you!

shokifrend007 commented 3 years ago

@NightZan999 Can you make a pull request with the changes? I can't figure out how to do it...

ghost commented 3 years ago

@NightZan999 Can you make a pull request with the changes? I can't figure out how to do it...

Yep on that right now lol.

ghost commented 3 years ago

Okay I made a pull request which hopefully gets taken as it fixes this game... #10