Skip to content
6 changes: 6 additions & 0 deletions game_manager/board_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ def removeFullLines(self):
lines += 1
if lines > 0:
self.backBoard = newBackBoard
if lines > 0:
self.current_action_message = f"{lines} LINE!!"
self.last_action_time = datetime.now()
return lines


Expand All @@ -553,6 +556,9 @@ def mergePiece(self):
# 画面ボードに書き込む
self.backBoard[x + y * BoardData.width] = self.currentShape.shape

self.current_action_message = "HOLD!!"
self.last_action_time = datetime.now()

# 現テトリミノ情報を初期化
self.currentX = -1
self.currentY = -1
Expand Down
10 changes: 10 additions & 0 deletions game_manager/game_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,11 @@ def getGameStatus(self):
print("warning: current shape is none !!!")

return status
if self.last_action_time and (datetime.now() - self.last_action_time).total_seconds() < 1:
status["action_message"] = self.current_action_message
else:

status["action_message"] = ""
def getGameStatusJson(self):
status = {
"debug_info":
Expand Down Expand Up @@ -1022,6 +1026,9 @@ def paintEvent(self, event):
painter.drawLine(self.width(), 0, self.width(), self.height())
# Draw text
painter.setPen(QColor(0x777777))
if self.last_action_time and (datetime.now() - self.last_action_time).total_seconds() < 1:
painter.drawText(10, 50, self.current_action_message)

font = painter.font();
font.setPixelSize(30);
painter.setFont(font);
Expand All @@ -1033,9 +1040,12 @@ def paintEvent(self, event):
for i in range(4):
val = self.line_score_stat_len[i]
if val != 0:
self.current_action_message = ""
self.current_action_message = ""
text = str(i+1) + 'LINE !!'
linen = "line" + str(i+1)
text += '+' + str(GAME_MANEGER.getGameStatus()["debug_info"]["line_score"][linen])
self.last_action_time = None
break
painter.drawText(10, 120, text);
# LEN
Expand Down