-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclicksMenu.py
More file actions
59 lines (49 loc) · 2.08 KB
/
Copy pathclicksMenu.py
File metadata and controls
59 lines (49 loc) · 2.08 KB
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
import pygame
import pygame_menu
pygame.init()
class clicksMenu():
def __init__(self,clicks, money):
self.clicks = clicks
self.money = money
self.surface = pygame.display.set_mode((600,700))
self.Continue = False
self.costOne = 10
self.costFive = 50
self.costTwentyFive = 500
def start_the_game(self):
self.Continue = True
self.menu.disable()
def upgradeBy1(self):
if (self.money.getMoneyAmount() - self.costOne < 0):
return
self.money.purchaseUpgrade(self.costOne)
self.costOne *= 2
self.currentAmountPerClick = self.clicks.getAmountPerClick()
self.currentAmountPerClick += 1
self.clicks.setAmountPerClick(self.currentAmountPerClick)
self.menu.disable()
def upgradeBy5(self):
if (self.money.getMoneyAmount() - self.costFive < 0):
return
self.money.purchaseUpgrade(self.costFive)
self.costFive *= 2
self.currentAmountPerClick = self.clicks.getAmountPerClick()
self.currentAmountPerClick += 5
self.clicks.setAmountPerClick(self.currentAmountPerClick)
self.menu.disable()
def upgradeBy25(self):
if (self.money.getMoneyAmount() - self.costTwentyFive < 0):
return
self.money.purchaseUpgrade(self.costTwentyFive)
self.costTwentyFive *= 2
self.currentAmountPerClick = self.clicks.getAmountPerClick()
self.currentAmountPerClick += 25
self.clicks.setAmountPerClick(self.currentAmountPerClick)
self.menu.disable()
def run(self):
self.menu = pygame_menu.Menu("Upgrade Potions Earned Per Click", 600, 700, theme=pygame_menu.themes.THEME_BLUE)
self.menu.add.button(f'Upgrade By 1 (Cost: {self.costOne})', self.upgradeBy1)
self.menu.add.button(f'Upgrade By 5 (Cost: {self.costFive})', self.upgradeBy5)
self.menu.add.button(f'Upgrade By 25 (Cost: {self.costTwentyFive})', self.upgradeBy25)
self.menu.add.button(f'Back To Game', self.start_the_game)
self.menu.mainloop(self.surface)