parent
c4da572007
commit
a83f741613
|
@ -80,7 +80,7 @@ func _calculate_drop_pos(grid_pos: Vector2) -> Vector2:
|
|||
|
||||
#Löscht eine Zeile nach dem Glücksrad ereignis
|
||||
func delete_column(column: int) -> void:
|
||||
for j in range((column - 3), -1, -1):
|
||||
for j in range((column - 2), -1, -1):
|
||||
for i in range(-2, 4, 1):
|
||||
var tile_map_cell_position = Vector2i(i,j)
|
||||
var tile_data = self.get_cell_tile_data(tile_map_layer, tile_map_cell_position)
|
||||
|
@ -90,6 +90,8 @@ func delete_column(column: int) -> void:
|
|||
var tile_map_cell_alternative = self.get_cell_alternative_tile(tile_map_layer, tile_map_cell_position)
|
||||
var new_tile_map_cell_position = Vector2i(i, j + 1)
|
||||
self.set_cell(tile_map_layer, new_tile_map_cell_position, tile_map_cell_source_id, tile_map_cell_atlas_coords, tile_map_cell_alternative)
|
||||
if j == 0:
|
||||
self.set_cell(tile_map_layer, Vector2i(i, 0))
|
||||
else:
|
||||
#Falls kein Inhalt, leer setzten
|
||||
self.set_cell(tile_map_layer, Vector2i(i, j + 1))
|
||||
|
@ -112,6 +114,8 @@ func _clear_enemy_tile(grid_pos: Vector2) -> void:
|
|||
var tile_map_cell_alternative = self.get_cell_alternative_tile(tile_map_layer, tile_map_cell_position)
|
||||
var new_tile_map_cell_position = Vector2i(true_position.x, i + 1)
|
||||
self.set_cell(tile_map_layer, new_tile_map_cell_position, tile_map_cell_source_id, tile_map_cell_atlas_coords, tile_map_cell_alternative)
|
||||
if i == 0:
|
||||
self.set_cell(tile_map_layer, Vector2i(true_position.x, 0))
|
||||
else:
|
||||
#Falls kein Inhalt, leer setzten
|
||||
self.set_cell(tile_map_layer, Vector2i(true_position.x, i + 1))
|
||||
|
|
4
game.gd
4
game.gd
|
@ -162,7 +162,7 @@ func _instant_win():
|
|||
|
||||
#Zum Testen der Events
|
||||
func _on_test_pressed():
|
||||
board.delete_row(3)
|
||||
board.delete_column(6)
|
||||
|
||||
|
||||
func _spin_the_wheel(result: int) -> void:
|
||||
|
@ -179,7 +179,7 @@ func _spin_the_wheel(result: int) -> void:
|
|||
_five_wins()
|
||||
elif result <= 65:
|
||||
print("delete column")#Debug
|
||||
board.delete_column(2)
|
||||
board.delete_column(6)
|
||||
elif result <= 85:
|
||||
print("delete row")#Debug
|
||||
board.delete_row(3)
|
||||
|
|
Loading…
Reference in New Issue