2021-05-29 20:08:15 -04:00
|
|
|
"""
|
|
|
|
Launch script for Pocket Friends.
|
|
|
|
"""
|
2021-06-12 22:06:48 -04:00
|
|
|
import os
|
2021-05-29 20:08:15 -04:00
|
|
|
import pygame
|
|
|
|
import sys
|
2023-05-11 11:24:42 -04:00
|
|
|
from pathlib import Path
|
2023-05-13 13:11:47 -04:00
|
|
|
import pocket_friends.game as game
|
2021-05-29 20:08:15 -04:00
|
|
|
|
2021-05-29 22:17:22 -04:00
|
|
|
if __name__ == '__main__':
|
2021-05-29 20:08:15 -04:00
|
|
|
enable_dev = False
|
2023-05-13 10:30:27 -04:00
|
|
|
resolution = 240
|
2021-05-29 20:08:15 -04:00
|
|
|
|
2021-05-29 21:42:33 -04:00
|
|
|
# enable dev mode if --dev argument is passed
|
|
|
|
if len(sys.argv) > 0:
|
2023-05-12 23:42:21 -04:00
|
|
|
for arg in sys.argv:
|
|
|
|
if arg == '--delete-save':
|
2021-06-12 22:06:48 -04:00
|
|
|
save_dir = os.path.join(Path.home(), '.pocket_friends')
|
|
|
|
os.remove(save_dir + '/save.json')
|
2023-05-13 10:30:27 -04:00
|
|
|
if '--res=' in arg:
|
|
|
|
resolution = int(arg.split('=')[1])
|
2021-06-12 22:06:48 -04:00
|
|
|
|
2023-05-14 17:10:34 -04:00
|
|
|
game.start_game(resolution)
|
2021-05-29 20:08:15 -04:00
|
|
|
|
2021-05-29 21:42:33 -04:00
|
|
|
pygame.quit()
|
|
|
|
sys.exit()
|