Skip to content

Commit

Permalink
feat: basic combo size scaling, 1x integer scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
russmatney committed Jun 23, 2024
1 parent 8bf9538 commit 18d996a
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ SoundManager="*res://addons/sound_manager/sound_manager.gd"
[display]

window/stretch/aspect="keep_width"
window/stretch/scale=2.0
window/stretch/scale_mode="integer"

[editor]
14 changes: 10 additions & 4 deletions src/BloxBucket.gd
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ signal clear_complete
signal split_complete

var grid_state
var combo_level = 0

signal piece_added

@@ -233,14 +234,16 @@ func on_pieces_split():

func on_groups_cleared(groups: Array):
Log.info("group cleared", groups)
combo_level += 1
var t = 0.3
var tween = create_tween()
var rects = []
for cells in groups:
for color_rect in get_color_rects(cells):
rects.append(color_rect)
tween.parallel().tween_property(color_rect, "color", Color.WHITE, t)
tween.parallel().tween_property(color_rect, "size", color_rect.size * 1.4, t)
tween.parallel().tween_property(color_rect, "color",
[Color.WHITE, Color.BLACK].pick_random(), t)
tween.parallel().tween_property(color_rect, "size", color_rect.size * 1.4 * combo_level, t)
tween.parallel().tween_property(color_rect, "rotation", PI, t)
clear_color_rects(cells)

@@ -253,14 +256,16 @@ func on_groups_cleared(groups: Array):

func on_rows_cleared(rows: Array):
Log.info("rows cleared", rows)
combo_level += 1
var tween = create_tween()
var t = 0.3
var rects = []
for cells in rows:
for color_rect in get_color_rects(cells):
rects.append(color_rect)
tween.parallel().tween_property(color_rect, "color", Color.WHITE, t)
tween.parallel().tween_property(color_rect, "size", color_rect.size * 1.4, t)
tween.parallel().tween_property(color_rect, "color",
[Color.WHITE, Color.BLACK].pick_random(), t)
tween.parallel().tween_property(color_rect, "size", color_rect.size * 1.4 * combo_level, t)
tween.parallel().tween_property(color_rect, "rotation", PI, t)
clear_color_rects(cells)

@@ -275,6 +280,7 @@ func start_next_piece():
if current_piece:
Log.warn("already have a current_piece!?")

combo_level = 0
if len(piece_queue) < 4:
queue_pieces()

0 comments on commit 18d996a

Please sign in to comment.