Skip to content

Commit 58a86d0

Browse files
v1.4-alpha.2 upload
1 parent 18abd9c commit 58a86d0

File tree

11 files changed

+905
-0
lines changed

11 files changed

+905
-0
lines changed

v1.4-alpha.2/clicker/gui.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
def clicker_start_game():
3+
pass

v1.4-alpha.2/launcher.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import time, os, random
2+
from mrmine.main_script import mrmine_start_game, m_ms_initialize
3+
from mrmine.keypress_detector import m_kd_initialize
4+
from mrmine.gui import m_g_initialize
5+
from clicker.main_script import clicker_start_game
6+
from mrmine_integrity import m_ic_initialize
7+
from colorama import Fore as color
8+
os.system('clear')
9+
version='v1.4-alpha.2'
10+
print(f'''
11+
You are on version {version}.
12+
To see all versions go to:
13+
https://github.com/XtheGxmerz0/coolmathgames''')
14+
time.sleep(0.75)
15+
print('''
16+
Enter the ID for the game you would like to play.
17+
1. Mr. Mine | [v1.4-alpha.2, Work-In-Progress]
18+
2: Clicker Game | [v1.0, Work-In-Progress]''')
19+
game=input(" > ")
20+
try:
21+
game=int(game)
22+
except Exception:
23+
print("Invalid ID.")
24+
exit()
25+
if game==1:
26+
print("Starting Mr. Mine...")
27+
time.sleep(0.5)
28+
print("Loading Game...")
29+
time.sleep(random.uniform(0.5, 1.5))
30+
os.system('clear')
31+
#i=0
32+
#d1=random.randint(-3, 3)
33+
#d2=random.randint(-3, 3)
34+
#d3=random.randint(-3, 3)
35+
#while i<100:
36+
#os.system('clear')
37+
# print("="*102)
38+
# print("|"+color.GREEN+("█"*i)+color.RESET+("█"*(100-i))+"|")
39+
# print("|"+color.GREEN+("█"*i)+color.RESET+("█"*(100-i))+"| ("+str(i)+"%)")
40+
# print("="*102)
41+
# if i<=15+d1:
42+
# print(color.RESET+"Loading Launcher...")
43+
# elif i<=50+d2:
44+
# print(color.RESET+"Initializing Game...")
45+
# elif i<100:
46+
# print("Loading Scripts...")
47+
# elif i==100:
48+
# break
49+
# i+=1
50+
# time.sleep(random.uniform(0.05, 0.2))
51+
#os.system('clear')
52+
#print("="*102)
53+
#print("|"+color.GREEN+("█"*100)+color.RESET+"|")
54+
#print("|"+color.GREEN+("█"*100)+color.RESET+"| (100%)")
55+
#print("="*102)
56+
print(color.RESET+'Initializing main script...')
57+
m_ms_initialize()
58+
print(color.RESET+'Initializing GUI...')
59+
m_g_initialize()
60+
print(color.RESET+'Initializing keypress detector...')
61+
m_kd_initialize()
62+
print(color.RESET+'Performing integrity check...')
63+
m_ic_initialize()
64+
print(color.RESET+"Loading Complete!")
65+
time.sleep(1)
66+
print(color.RESET+"Welcome to Mr. Mine!")
67+
time.sleep(0.5)
68+
os.system('clear')
69+
mrmine_start_game()

v1.4-alpha.2/mrmine/gui.py

Lines changed: 341 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import sys
2+
import termios
3+
import tty
4+
import select
5+
import time
6+
from contextlib import contextmanager
7+
log_loc= '/workspaces/coolmathgames/v1.4-alpha.2/mrmine/log.txt'
8+
def write_log(message):
9+
with open(log_loc, "a") as log_file:
10+
message1=('Timestamp '+ str(time.time())+': '+ str(message) + "\n")
11+
log_file.write(message1)
12+
def m_kd_initialize():
13+
write_log('From function \'initialize\': Initializing script...')
14+
@contextmanager
15+
def raw_mode(file):
16+
old_attrs = termios.tcgetattr(file.fileno())
17+
try:
18+
tty.setraw(file.fileno())
19+
yield
20+
finally:
21+
termios.tcsetattr(file.fileno(), termios.TCSADRAIN, old_attrs)
22+
23+
SPECIAL_KEYS = {
24+
'\x1b[A': 'UP',
25+
'\x1b[B': 'DOWN',
26+
'\x1b[C': 'RIGHT',
27+
'\x1b[D': 'LEFT'
28+
}
29+
30+
def detect_keypress_nonblocking():
31+
with raw_mode(sys.stdin):
32+
rlist, _, _ = select.select([sys.stdin], [], [], 0.1)
33+
if rlist:
34+
chars = []
35+
char = sys.stdin.read(1)
36+
if char == '\x1b': # Escape character
37+
chars.append(char)
38+
char = sys.stdin.read(1)
39+
if char:
40+
chars.append(char)
41+
if char == '[':
42+
char = sys.stdin.read(1)
43+
if char:
44+
chars.append(char)
45+
result = ''.join(chars)
46+
return SPECIAL_KEYS.get(result, result)
47+
return None

v1.4-alpha.2/mrmine/log.txt

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Timestamp 1730739044.6277072: From function 'clear_log': clearing log file
2+
Timestamp 1730739044.6297894: From function 'read_save': grabbed set ('SAVE_NUMBER', '1') from save
3+
Timestamp 1730739044.6299198: From function 'read_save': writing save data key SAVE_NUMBER to data dictionary
4+
Timestamp 1730739044.6299903: From function 'read_save': grabbed set ('END_TIME', '0') from save
5+
Timestamp 1730739044.6300752: From function 'read_save': writing save data key END_TIME to data dictionary
6+
Timestamp 1730739044.6301606: From function 'read_save': grabbed set ('STORAGE', '0') from save
7+
Timestamp 1730739044.6302505: From function 'read_save': writing save data key STORAGE to data dictionary
8+
Timestamp 1730739044.630317: From function 'read_save': grabbed set ('UPGRADES', '[]') from save
9+
Timestamp 1730739044.6304035: From function 'read_save': writing save data key UPGRADES to data dictionary
10+
Timestamp 1730739044.6304696: From function 'read_save': grabbed set ('MINERALS', '[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]') from save
11+
Timestamp 1730739044.6305985: From function 'read_save': writing save data key MINERALS to data dictionary
12+
Timestamp 1730739044.630664: From function 'read_save': grabbed set ('FLUIDS', '[0, 0, 0]') from save
13+
Timestamp 1730739044.6307545: From function 'read_save': writing save data key FLUIDS to data dictionary
14+
Timestamp 1730739044.6308196: From function 'read_save': grabbed set ('SCIENTIST_DATA', '[]') from save
15+
Timestamp 1730739044.6308985: From function 'read_save': writing save data key SCIENTIST_DATA to data dictionary
16+
Timestamp 1730739044.6309628: From function 'read_save': grabbed set ('CAVE_DATA', '[]') from save
17+
Timestamp 1730739044.631043: From function 'read_save': writing save data key CAVE_DATA to data dictionary
18+
Timestamp 1730739044.6311066: From function 'read_save': grabbed set ('CHEST_DATA', '[]') from save
19+
Timestamp 1730739044.6311846: From function 'read_save': writing save data key CHEST_DATA to data dictionary
20+
Timestamp 1730739044.6312506: From function 'read_save': grabbed set ('MONEY', '0') from save
21+
Timestamp 1730739044.6313264: From function 'read_save': writing save data key MONEY to data dictionary
22+
Timestamp 1730739044.6313858: From function 'read_save': grabbed set ('TP_DATA', '[]') from save
23+
Timestamp 1730739044.6314642: From function 'read_save': writing save data key TP_DATA to data dictionary
24+
Timestamp 1730739044.6315289: From function 'read_save': grabbed set ('MANAGER', '(0.0, 0)') from save
25+
Timestamp 1730739044.6316211: From function 'read_save': writing save data key MANAGER to data dictionary
26+
Timestamp 1730739044.631689: From function 'read_save': grabbed set ('ATTACK', '(0, 0)') from save
27+
Timestamp 1730739044.6317768: From function 'read_save': writing save data key ATTACK to data dictionary
28+
Timestamp 1730739044.6318374: From function 'read_save': grabbed set ('MINER_SPEED', '1') from save
29+
Timestamp 1730739044.6319149: From function 'read_save': writing save data key MINER_SPEED to data dictionary
30+
Timestamp 1730739044.631973: From function 'read_save': grabbed set ('MINER_EFFICIENCY', '1') from save
31+
Timestamp 1730739044.63205: From function 'read_save': writing save data key MINER_EFFICIENCY to data dictionary
32+
Timestamp 1730739044.6321125: From function 'read_save': grabbed set ('DEPTH', '4') from save
33+
Timestamp 1730739044.6321907: From function 'read_save': writing save data key DEPTH to data dictionary
34+
Timestamp 1730739044.632254: From function 'read_save': grabbed set ('DRILL_DATA', '[1, 1]') from save
35+
Timestamp 1730739044.6323392: From function 'read_save': writing save data key DRILL_DATA to data dictionary
36+
Timestamp 1730739044.6324027: From function 'read_save': grabbed set ('RIG_DATA', '[]') from save
37+
Timestamp 1730739044.632488: From function 'read_save': writing save data key RIG_DATA to data dictionary
38+
Timestamp 1730739044.6325517: From function 'read_save': grabbed set ('LAYER_HARDNESS', '1') from save
39+
Timestamp 1730739044.6326306: From function 'read_save': writing save data key LAYER_HARDNESS to data dictionary
40+
Timestamp 1730739044.6326938: From function 'read_save': grabbed set ('FORGE_STATUS', '[]') from save
41+
Timestamp 1730739044.6327906: From function 'read_save': writing save data key FORGE_STATUS to data dictionary
42+
Timestamp 1730739044.6328576: From function 'read_save': grabbed set ('BROADCAST', 'nothing') from save
43+
Timestamp 1730739044.6329522: From function 'read_save': eval failed; writing directly to data dictionary
44+
Timestamp 1730739044.6330147: From function 'read_save': eval failed with traceback name 'nothing' is not defined.
45+
Timestamp 1730739044.6330829: From function 'read_save': grabbed set ('BROADCAST_TYPE', 'nothing') from save
46+
Timestamp 1730739044.6331744: From function 'read_save': eval failed; writing directly to data dictionary
47+
Timestamp 1730739044.6332395: From function 'read_save': eval failed with traceback name 'nothing' is not defined.
48+
Timestamp 1730739044.6333244: From function 'read_save': grabbed set ('DATAID', '33570753') from save
49+
Timestamp 1730739044.6334062: From function 'read_save': writing save data key DATAID to data dictionary
50+
Timestamp 1730739044.633527: From function 'read_save': grabbed set ('PLANET', '1') from save
51+
Timestamp 1730739044.633681: From function 'read_save': writing save data key PLANET to data dictionary
52+
Timestamp 1730739044.6337533: From function 'read_save': grabbed set ('VERSION', 'v1.4-alpha') from save
53+
Timestamp 1730739044.633842: From function 'read_save': eval failed; writing directly to data dictionary
54+
Timestamp 1730739044.6339056: From function 'read_save': eval failed with traceback invalid syntax (<string>, line 1).
55+
Timestamp 1730739044.6340158: From function 'write_save': attempting to write to save file (attempt 1)
56+
Timestamp 1730739044.6341553: From function 'write_save': opened save file
57+
Timestamp 1730739044.6342187: From function 'write_save': writing item SAVE_NUMBER
58+
Timestamp 1730739044.6345468: From function 'write_save': writing item END_TIME
59+
Timestamp 1730739044.634623: From function 'write_save': writing item STORAGE
60+
Timestamp 1730739044.6346877: From function 'write_save': writing item UPGRADES
61+
Timestamp 1730739044.6347437: From function 'write_save': writing item MINERALS
62+
Timestamp 1730739044.634801: From function 'write_save': writing item FLUIDS
63+
Timestamp 1730739044.634854: From function 'write_save': writing item SCIENTIST_DATA
64+
Timestamp 1730739044.6349063: From function 'write_save': writing item CAVE_DATA
65+
Timestamp 1730739044.6349585: From function 'write_save': writing item CHEST_DATA
66+
Timestamp 1730739044.6350107: From function 'write_save': writing item MONEY
67+
Timestamp 1730739044.6350644: From function 'write_save': writing item TP_DATA
68+
Timestamp 1730739044.6351151: From function 'write_save': writing item MANAGER
69+
Timestamp 1730739044.6351697: From function 'write_save': writing item ATTACK
70+
Timestamp 1730739044.6352212: From function 'write_save': writing item MINER_SPEED
71+
Timestamp 1730739044.6352725: From function 'write_save': writing item MINER_EFFICIENCY
72+
Timestamp 1730739044.635324: From function 'write_save': writing item DEPTH
73+
Timestamp 1730739044.6353798: From function 'write_save': writing item DRILL_DATA
74+
Timestamp 1730739044.6354432: From function 'write_save': writing item RIG_DATA
75+
Timestamp 1730739044.6354942: From function 'write_save': writing item LAYER_HARDNESS
76+
Timestamp 1730739044.6355455: From function 'write_save': writing item FORGE_STATUS
77+
Timestamp 1730739044.6355968: From function 'write_save': writing item BROADCAST
78+
Timestamp 1730739044.6356485: From function 'write_save': writing item BROADCAST_TYPE
79+
Timestamp 1730739044.635698: From function 'write_save': writing item DATAID
80+
Timestamp 1730739044.6357484: From function 'write_save': writing item PLANET
81+
Timestamp 1730739044.6358004: From function 'write_save': writing item VERSION
82+
Timestamp 1730739044.635904: From function 'write_save': success
83+
Timestamp 1730739044.6360395: From function 'mrmine_start_game': Verifying save file integrity...
84+
Timestamp 1730739044.6360962: From function 'mrmine_save_game': Save file integrity verified.
85+
Timestamp 1730739045.6374946: From function 'drill_percent': new layer; new hardness is 25.072440394624508.
86+
Timestamp 1730739051.3129816: From function 'initialize': Initializing script...
87+
Timestamp 1730739051.3132975: From function 'initialize': Initializing script...
88+
Timestamp 1730739051.3133907: From function 'initialize': Initializing script...

0 commit comments

Comments
 (0)