-
Notifications
You must be signed in to change notification settings - Fork 3
/
game.py
executable file
·41 lines (36 loc) · 944 Bytes
/
game.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
#!/usr/bin/env python
import pygame as pg
from data.main import main
import data.tools
import argparse
import sys
from data.tools import DB
DEFAULT = {
'fullscreen':False,
'difficulty':'medium',
'size' :(500, 400),
'caption' :'Flood It',
'resizable' :False,
'save':{
'won':0,
'lost':0,
'points':0,
'shortest':None,
},
}
parser = argparse.ArgumentParser(description='{} Arguments'.format(DEFAULT['caption']))
parser.add_argument('-c','--clean', action='store_true',
help='Remove all .pyc files and __pycache__ directories')
args = vars(parser.parse_args())
if __name__ == '__main__':
if args['clean']:
data.tools.clean_files()
else:
if not DB.exists():
DB.save(DEFAULT)
db = DEFAULT
else:
db = DB.load()
print(db)
main(**db)
pg.quit()