This commit is contained in:
Auric Vente 2024-07-21 23:15:09 -06:00
parent 0d22a4280f
commit 4c2a8edb7c
2 changed files with 8 additions and 12 deletions

View File

@ -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:

View File

@ -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 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"