File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ func fill_grid(hbox:HBoxContainer, grid:GridContainer):
2222 # Add the instantiated square to the grid container
2323 grid .add_child (brdsq )
2424
25- func fill_hbox (hbox :HBoxContainer ):
25+ func fill_hbox (hbox :HBoxContainer , on_cell_click ):
2626 for col_idx in range (hbox .get_child_count ()):
2727 for row_idx in range (8 ):
2828 # A: random gem
@@ -33,7 +33,7 @@ func fill_hbox(hbox:HBoxContainer):
3333 hbox .get_child (col_idx ).add_child (gem_cell )
3434 gem_cell .initialize (gem_type )
3535 var control_node = gem_cell .get_node ("GemControl" )
36- control_node .connect ("cell_click" , self . _on_cell_click )
36+ control_node .connect ("cell_click" , on_cell_click )
3737 # control_node.connect("drag_start", self._on_cell_click) # TODO:
3838 # control_node.connect("drag_ended", self._on_cell_click) # TODO:
3939
@@ -80,7 +80,7 @@ func get_all_matches(hbox:HBoxContainer) -> Array:
8080 var streak = 0
8181 var match_start = 0
8282 for row in range (num_rows ):
83- var gem_cell = hbox .get_child (column ).get_child (row ) as GemCell1
83+ var gem_cell = hbox .get_child (column ).get_child (row ) as CommonGemCell
8484 if gem_cell .gem_color == last_color :
8585 streak += 1
8686 else :
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ func _ready():
2727 randomize ()
2828 # A: populate board
2929 CmnFunc .fill_grid (hbox_container , grid_container )
30- CmnFunc .fill_hbox (hbox_container )
30+ CmnFunc .fill_hbox (hbox_container , self . _on_cell_click )
3131 # B: check board after init
3232 process_game_round ()
3333
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ func _ready():
2727 randomize ()
2828 # A: populate board
2929 CmnFunc .fill_grid (hbox_container , grid_container )
30- CmnFunc .fill_hbox (hbox_container )
30+ CmnFunc .fill_hbox (hbox_container , self . _on_cell_click )
3131 # B: check board after init
3232 process_game_round ()
3333
You can’t perform that action at this time.
0 commit comments