v.0.5.5.1 kleiner Bugfix

bug war bei dem entfernen von Zeilen
main
Daniel Lehmann 2024-03-29 22:09:12 +01:00
parent c4da572007
commit a83f741613
2 changed files with 7 additions and 3 deletions

View File

@ -80,7 +80,7 @@ func _calculate_drop_pos(grid_pos: Vector2) -> Vector2:
#Löscht eine Zeile nach dem Glücksrad ereignis #Löscht eine Zeile nach dem Glücksrad ereignis
func delete_column(column: int) -> void: 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): for i in range(-2, 4, 1):
var tile_map_cell_position = Vector2i(i,j) var tile_map_cell_position = Vector2i(i,j)
var tile_data = self.get_cell_tile_data(tile_map_layer, tile_map_cell_position) 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 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) 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) 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: else:
#Falls kein Inhalt, leer setzten #Falls kein Inhalt, leer setzten
self.set_cell(tile_map_layer, Vector2i(i, j + 1)) 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 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) 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) 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: else:
#Falls kein Inhalt, leer setzten #Falls kein Inhalt, leer setzten
self.set_cell(tile_map_layer, Vector2i(true_position.x, i + 1)) self.set_cell(tile_map_layer, Vector2i(true_position.x, i + 1))

View File

@ -162,7 +162,7 @@ func _instant_win():
#Zum Testen der Events #Zum Testen der Events
func _on_test_pressed(): func _on_test_pressed():
board.delete_row(3) board.delete_column(6)
func _spin_the_wheel(result: int) -> void: func _spin_the_wheel(result: int) -> void:
@ -179,7 +179,7 @@ func _spin_the_wheel(result: int) -> void:
_five_wins() _five_wins()
elif result <= 65: elif result <= 65:
print("delete column")#Debug print("delete column")#Debug
board.delete_column(2) board.delete_column(6)
elif result <= 85: elif result <= 85:
print("delete row")#Debug print("delete row")#Debug
board.delete_row(3) board.delete_row(3)