Add files via upload

Tuning blocks' style
This commit is contained in:
adrienmalin 2018-07-31 11:35:44 +02:00 committed by GitHub
parent 4fabcacbb8
commit 421cc37a36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,8 +107,8 @@ class Block:
BORDER_COLOR = QtGui.QColor(0, 159, 218, 255)
FILL_COLOR = QtGui.QColor(0, 159, 218, 25)
GLOWING_BORDER_COLOR = None
GLOWING_FILL_COLOR = QtGui.QColor(169, 204, 216, 50)
LIGHT_COLOR = QtGui.QColor(204, 255, 255, 70)
GLOWING_FILL_COLOR = QtGui.QColor(186, 211, 255, 70)
LIGHT_COLOR = QtGui.QColor(204, 255, 255, 40)
TRANSPARENT = QtGui.QColor(255, 255, 255, 0)
GLOWING = 0
@ -124,7 +124,7 @@ class Block:
def paint(self, painter, top_left_corner, spotlight):
p = top_left_corner + self.coord * Block.side
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:
start = (
@ -1089,6 +1089,27 @@ class Stats(QtWidgets.QWidget):
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
# Two major bonus actions, such as two Tetrises, performed without
@ -1120,27 +1141,6 @@ class Stats(QtWidgets.QWidget):
)
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.update()
@ -1912,7 +1912,7 @@ class Window(QtWidgets.QMainWindow):
qsettings.setValue("WindowState", int(self.windowState()))
def main(args):
def main(args={}):
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication(args)
win = Window()
return app.exec_()