refactoring

bug fix equip multi
This commit is contained in:
2022-10-22 12:05:45 +02:00
parent 4bfa9aa408
commit f1bde80746
4 changed files with 71 additions and 65 deletions

View File

@@ -126,7 +126,8 @@ class Crops(GameBase):
color_list = [PURPLE, BLUE, RED, YELLOW, GREEN]
random.shuffle(color_list)
self.set_color_order(color_list)
self.current_strategy = random.choice([RAINBOW_STRATEGY, BIGBOMB_STRATEGY, ROCKET_STRATEGY, BOMB_STRATEGY])
self.current_strategy = random.choice([RAINBOW_STRATEGY, BIGBOMB_STRATEGY,
ROCKET_STRATEGY, BOMB_STRATEGY])
self.reset_counter = 0
return
else:
@@ -256,7 +257,8 @@ class Crops(GameBase):
self.execute_move(res_dic[key])
break
def convert_moves_to_dic_by_color(self, reserve_moves):
@staticmethod
def convert_moves_to_dic_by_color(reserve_moves):
dic = {}
for color, move in reserve_moves:
if color in dic:
@@ -295,7 +297,8 @@ class Crops(GameBase):
pydirectinput.mouseUp()
cv.waitKey(50)
def get_directions_array(self, current_x, current_y):
@staticmethod
def get_directions_array(current_x, current_y):
left_x = current_x
left_y = current_y - 1