Grimmys / rpg_tactical_fantasy_game

A tactical turn-based game project in pygame, open to support
GNU General Public License v3.0
392 stars 85 forks source link

Suggestion: Environment requirements add "python3.9 and above" #60

Closed JimZhouZZY closed 11 months ago

JimZhouZZY commented 11 months ago

Due to the syntax change of Python3.9, the following error will occur when running the source code in Python3.8 and below

pygame 2.5.0 (SDL 2.28.0, Python 3.8.0)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "main.py", line 13, in <module>
    from src.gui.tools import show_fps
  File "D:\Py\RPG\rpg_tactical_fantasy_game-master\rpg_tactical_fantasy_game-master\src\gui\tools.py", line 12, in <module>
    from src.gui.position import Position
  File "D:\Py\RPG\rpg_tactical_fantasy_game-master\rpg_tactical_fantasy_game-master\src\gui\position.py", line 9, in <module>
    Position = Union[pygame.Vector2, tuple[int, int]]
TypeError: 'type' object is not subscriptable

This small error puzzled me for a little while. So I suggest writting this environment requirement into README.md. Thank you for reading. : )

JimZhouZZY commented 11 months ago

61

JimZhouZZY commented 11 months ago

Oh, I found there exists commit on "Add compatibility with Python 3.8". But I can't still run the code in Python3.8. Is that my environments' problem?

Grimmys commented 11 months ago

Oh, I found there exists commit on "Add compatibility with Python 3.8". But I can't still run the code in Python3.8. Is that my environments' problem?

As per answered in the PR, it is not your environment problem, but me who should rethink my testing process.