-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_control.py
More file actions
60 lines (44 loc) · 1.75 KB
/
game_control.py
File metadata and controls
60 lines (44 loc) · 1.75 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
60
from time import sleep
from configuration import Configuration
from mouse import Mouse
class GameControl:
def __init__(self):
self.configuration = Configuration()
self.mouse = Mouse()
pass
def resume_game(self):
coords = self.configuration.get_button_coords(Configuration.BUTTON_RESUME_GAME)
coords = tuple(coords)
self.mouse.click_and_back(*coords)
pass
def click_letter(self, letter_dict):
coords = self.configuration.get_button_coords('tile_{}_{}'.format(letter_dict['x'], letter_dict['y']))
coords = tuple(coords)
self.mouse.click_and_back(*coords)
def shuffle_tiles(self):
coords = self.configuration.get_button_coords(Configuration.BUTTON_SHUFFLE_TILES)
coords = tuple(coords)
self.mouse.click_and_back(*coords)
def accept_word(self):
coords = self.configuration.get_button_coords(Configuration.BUTTON_ACCEPT_TILES)
coords = tuple(coords)
self.mouse.click_and_back(*coords)
def cancel_word(self):
coords = self.configuration.get_button_coords(Configuration.BUTTON_CANCEL_TILES)
coords = tuple(coords)
self.mouse.click_and_back(*coords)
def exit_shop(self):
coords = self.configuration.get_button_coords(Configuration.BUTTON_EXIT_SHOP)
coords = tuple(coords)
self.mouse.click_and_back(*coords)
def chest_reward_prize(self, number):
coords = self.configuration.get_button_coords(Configuration.BUTTON_CHEST_REWARD_3)
coords = tuple(coords)
self.mouse.click_and_back(*coords)
def animation_break(self):
sleep(2)
if __name__ == '__main__':
# TODO REMOVE DEBUG
gc = GameControl()
gc.resume_game()
gc.exit_shop()