-
Notifications
You must be signed in to change notification settings - Fork 1
/
myStuff.py
88 lines (79 loc) · 2.53 KB
/
myStuff.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import os
import time
def myRound(x):
y = x % 1
x -= y
return x
'''defines the player'''
class player:
def __init__(self,mps,mpc,money):
self.mps = mps
self.mpc =mpc
self.money = money
'''THE GAME'''
class Game:
def __init__(self,costA,costB,player,click):
self.player = player
self.costA = costA
self.costB = costB
self.click = click
def moneyPerSecond(self):
while(True):
time.sleep(1)
self.player.money += self.player.mps
def mainMenu(self):
print("your money is: $", self.player.money)
print("Money per click: $",self.player.mpc)
print("Money per second: $",self.player.mps)
if click != "shop"
print("s for shop")
elif click == "shop"
buy = "a"
while(buy != "e"):
self.costA = myRound(self.costA)
self.costB = myRound(self.costB)
print("your money is: $",self.player.money)
print("Money per click: $",self.player.mpc)
print("Money per second: $",self.player.mps)
print("(e) for exit")
print("(a) to buy more money per click $",self.costA)
print("(b) to buy more money per second $",self.costB)
buy = input()
if (buy == "a" or buy == "A") and self.player.money >= self.costA:
self.player.mpc += 1
self.player.money -= self.costA
self.costA *= 1.25
print("succesfully purchased!")
time.sleep(0.2)
os.system("cls")
elif (buy == "b" or buy == "B") and self.player.money >= self.costB:
self.player.mps += 1
self.player.money -= self.costB
self.costB *= 1.25
print("succesfully purchased!")
time.sleep(0.2)
os.system("cls")
elif ((buy =="a" or buy == "A") and (self.player.money < self.costA)) or ((buy =="b" or buy =="B") and (self.player.money <self.costB)):
print("you don't have enough money.")
time.sleep(1)
os.system("cls")
elif buy != "e":
print("that is not a valid input")
time.sleep(1)
os.system("cls")
def clickInput(self):
click = input()
if click == "":
self.player.money += self.player.mpc
elif click == "s":
self.click = "shop"
elif click == "q":
print("hi")
sys.exit()
elif click == "asdfghjkl":
self.player.money += 100000000000
else:
print("that is not a valid input")
time.sleep(1)
def shop(self):
os.system("cls")