Mods
This commit is contained in:
parent
0d22a4280f
commit
4c2a8edb7c
|
@ -54,6 +54,7 @@ class Config:
|
|||
filter_width: int = 150
|
||||
filter_debouncer_delay: int = 200
|
||||
default_population: int = 100
|
||||
merge_goal: int = 8
|
||||
|
||||
@staticmethod
|
||||
def prepare() -> None:
|
||||
|
|
|
@ -34,7 +34,7 @@ class Method:
|
|||
class Game:
|
||||
timer: QTimer | None = None
|
||||
playing_song: bool = False
|
||||
last_update: int = 0
|
||||
merge_charge: int = 0
|
||||
|
||||
@staticmethod
|
||||
def prepare() -> None:
|
||||
|
@ -169,22 +169,17 @@ class Game:
|
|||
|
||||
min_num = 0
|
||||
max_num = 12
|
||||
no_repeat = [Method.merge]
|
||||
|
||||
num = random.randint(min_num, max_num)
|
||||
|
||||
if num in no_repeat:
|
||||
if Game.last_update == num:
|
||||
num = max_num
|
||||
|
||||
Game.last_update = num
|
||||
Game.merge_charge += 1
|
||||
|
||||
if num == Method.merge:
|
||||
if Ants.merge():
|
||||
return
|
||||
if Game.merge_charge >= Config.merge_goal:
|
||||
if Ants.merge():
|
||||
Game.merge_charge = 0
|
||||
return
|
||||
|
||||
# If merge failed
|
||||
num = max_num
|
||||
num = min_num
|
||||
|
||||
status = ""
|
||||
method = "normal"
|
||||
|
|
Loading…
Reference in New Issue