Add files via upload
Tuning blocks' style
This commit is contained in:
parent
4fabcacbb8
commit
421cc37a36
@ -107,8 +107,8 @@ class Block:
|
|||||||
BORDER_COLOR = QtGui.QColor(0, 159, 218, 255)
|
BORDER_COLOR = QtGui.QColor(0, 159, 218, 255)
|
||||||
FILL_COLOR = QtGui.QColor(0, 159, 218, 25)
|
FILL_COLOR = QtGui.QColor(0, 159, 218, 25)
|
||||||
GLOWING_BORDER_COLOR = None
|
GLOWING_BORDER_COLOR = None
|
||||||
GLOWING_FILL_COLOR = QtGui.QColor(169, 204, 216, 50)
|
GLOWING_FILL_COLOR = QtGui.QColor(186, 211, 255, 70)
|
||||||
LIGHT_COLOR = QtGui.QColor(204, 255, 255, 70)
|
LIGHT_COLOR = QtGui.QColor(204, 255, 255, 40)
|
||||||
TRANSPARENT = QtGui.QColor(255, 255, 255, 0)
|
TRANSPARENT = QtGui.QColor(255, 255, 255, 0)
|
||||||
GLOWING = 0
|
GLOWING = 0
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ class Block:
|
|||||||
def paint(self, painter, top_left_corner, spotlight):
|
def paint(self, painter, top_left_corner, spotlight):
|
||||||
p = top_left_corner + self.coord * Block.side
|
p = top_left_corner + self.coord * Block.side
|
||||||
self.center = p + QtCore.QPoint(Block.side / 2, Block.side / 2)
|
self.center = p + QtCore.QPoint(Block.side / 2, Block.side / 2)
|
||||||
self.glint = 0.10 * Block.side * spotlight + 0.90 * self.center
|
self.glint = 0.15 * Block.side * spotlight + 0.85 * self.center
|
||||||
|
|
||||||
if self.trail:
|
if self.trail:
|
||||||
start = (
|
start = (
|
||||||
@ -1089,6 +1089,27 @@ class Stats(QtWidgets.QWidget):
|
|||||||
|
|
||||||
self.temporary_text.emit(text + "\n{:n}".format(score))
|
self.temporary_text.emit(text + "\n{:n}".format(score))
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# Combo
|
||||||
|
# Bonus for complete lines on each consecutive lock downs
|
||||||
|
# if nb_complete_lines:
|
||||||
|
# ==============================================================================
|
||||||
|
if nb_complete_lines:
|
||||||
|
self.combo += 1
|
||||||
|
if self.combo > 0:
|
||||||
|
if nb_complete_lines == 1:
|
||||||
|
combo_score = 20 * self.combo * self.level
|
||||||
|
else:
|
||||||
|
combo_score = 50 * self.combo * self.level
|
||||||
|
self.score_total += combo_score
|
||||||
|
self.max_combo = max(self.max_combo, self.combo)
|
||||||
|
self.combos_total += 1
|
||||||
|
self.temporary_text.emit(
|
||||||
|
self.tr("COMBO x{:n}\n{:n}").format(self.combo, combo_score)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.combo = -1
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Back-to_back sequence
|
# Back-to_back sequence
|
||||||
# Two major bonus actions, such as two Tetrises, performed without
|
# Two major bonus actions, such as two Tetrises, performed without
|
||||||
@ -1120,27 +1141,6 @@ class Stats(QtWidgets.QWidget):
|
|||||||
)
|
)
|
||||||
self.back_to_back_scores = None
|
self.back_to_back_scores = None
|
||||||
|
|
||||||
# ==============================================================================
|
|
||||||
# Combo
|
|
||||||
# Bonus for complete lines on each consecutive lock downs
|
|
||||||
# if nb_complete_lines:
|
|
||||||
# ==============================================================================
|
|
||||||
self.combo += 1
|
|
||||||
if self.combo > 0:
|
|
||||||
if nb_complete_lines == 1:
|
|
||||||
combo_score = 20 * self.combo * self.level
|
|
||||||
else:
|
|
||||||
combo_score = 50 * self.combo * self.level
|
|
||||||
self.score_total += combo_score
|
|
||||||
self.max_combo = max(self.max_combo, self.combo)
|
|
||||||
self.combos_total += 1
|
|
||||||
self.temporary_text.emit(
|
|
||||||
self.tr("COMBO x{:n}\n{:n}").format(self.combo, combo_score)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
self.combo = -1
|
|
||||||
|
|
||||||
|
|
||||||
self.high_score = max(self.score_total, self.high_score)
|
self.high_score = max(self.score_total, self.high_score)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
@ -1912,7 +1912,7 @@ class Window(QtWidgets.QMainWindow):
|
|||||||
qsettings.setValue("WindowState", int(self.windowState()))
|
qsettings.setValue("WindowState", int(self.windowState()))
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args={}):
|
||||||
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication(args)
|
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication(args)
|
||||||
win = Window()
|
win = Window()
|
||||||
return app.exec_()
|
return app.exec_()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user