forked from irmen/bouldercaves
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startgame-venv.py
executable file
·41 lines (34 loc) · 1.47 KB
/
startgame-venv.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
36
37
38
39
40
41
#! /usr/bin/env python3
import venv
import os
import subprocess
# determine user data directory to store the virtual env files
if os.name == "posix":
venv_dir = os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")) + "/bouldercaves/venv"
symlink = True
executable = venv_dir + "/bin/python3"
elif os.name == "nt":
venv_dir = os.getenv("APPDATA") + "/bouldercaves/venv"
symlink = False
executable = venv_dir + "/Scripts/python.exe"
else:
venv_dir = os.expanduser("~/bouldercaves/venv")
symlink = True
executable = venv_dir + "/bin/python3"
print("Creating virtual python environment in: ", venv_dir)
builder = venv.EnvBuilder(system_site_packages=False, symlinks=symlink, upgrade=True, with_pip=True)
builder.create(venv_dir)
print("Installing game dependencies...")
subprocess.check_call([executable, "-m", "pip", "install", "-r", "requirements.txt"])
print("\n\n\n\n\n\n\n\nBoulderCaves can be played in two ways:\n")
print(" 1) RETRO style (small screen, original colors, original sounds)")
print(" 2) REMAKE style (large screen, modern colors, synthesized sounds)")
print("\n(there are even more possibilities if you use the command-line arguments yourself)")
choice = input("\nWhich style do you want to play (1/2)? ").strip()
print()
if choice == "1":
subprocess.call([executable, "-m", "bouldercaves", "--authentic"])
elif choice == "2":
subprocess.call([executable, "-m", "bouldercaves", "--synth"])
else:
print("Invalid choice.")