-
Notifications
You must be signed in to change notification settings - Fork 0
/
jogar.py
35 lines (27 loc) · 999 Bytes
/
jogar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import platform
import sys
import os
from app.jogo import Jogo
from app.var import *
def configurar_env():
if not is_venv():
if platform.system() == 'Windows':
os.system(f'python -m venv {NOME_VENV} && "{NOME_VENV}/Scripts/activate" && pip install -r requirements.txt')
main()
elif platform.system() == 'Linux':
os.system(f'python3 -m venv {NOME_VENV} && . {NOME_VENV}/bin/activate && pip install -r requirements.txt')
main()
else:
print('\n\nPlataforma não suportada.')
print('Crie e configure o ambiente virtual manualmente.\n\n')
else:
main()
def is_venv():
return (hasattr(sys, 'real_prefix') or
(hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))
def main():
game = Jogo(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
game.setup()
arcade.run()
if __name__ == "__main__":
configurar_env()