Add files via upload
This commit is contained in:
parent
f26b047748
commit
bce4a5cf26
11
terminis.py
11
terminis.py
@ -11,6 +11,7 @@ except ImportError:
|
|||||||
import random
|
import random
|
||||||
import sched
|
import sched
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
# You can change controls here.
|
# You can change controls here.
|
||||||
@ -28,7 +29,7 @@ CONTROLS = {
|
|||||||
"QUIT": "q"
|
"QUIT": "q"
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE = ".terminis"
|
FILE = os.path.expanduser(os.path.join('~', ".terminis"))
|
||||||
|
|
||||||
|
|
||||||
class Rotation:
|
class Rotation:
|
||||||
@ -503,8 +504,11 @@ class Stats(Window):
|
|||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
with open(FILE, mode='w') as f:
|
try:
|
||||||
f.write(str(self.high_score))
|
with open(FILE, mode='w') as f:
|
||||||
|
f.write(str(self.high_score))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Controls(Window):
|
class Controls(Window):
|
||||||
@ -683,4 +687,3 @@ def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user