Compare commits

..

No commits in common. "7084d586a88a9dc917949bd92aca2605c76a383c" and "b984d5b13dfc03cf64f95177a9ce6161b7023af4" have entirely different histories.

2 changed files with 7 additions and 31 deletions

View File

@ -79,7 +79,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_layer = 1 var tile_map_layer = 1
var tile_map_cell_position = Vector2i(i,j) var tile_map_cell_position = Vector2i(i,j)
@ -97,9 +97,8 @@ func delete_column(column: int) -> void:
func delete_row(row: int) -> void: func delete_row(row: int) -> void:
var tile_map_layer = 1 var tile_map_layer = 1
for i in range(6): for i in range(6):
#Inhalt leer setzten (row -3 damit es mit 1 - 6 funktioniert) #Inhalt leer setzten
self.set_cell(tile_map_layer, Vector2i(row - 3, i)) self.set_cell(tile_map_layer, Vector2i(row - 2, i))

23
game.gd
View File

@ -3,7 +3,6 @@ extends Node2D
var current_player: int = 0 var current_player: int = 0
var player_states := ["Circle", "Cross"] var player_states := ["Circle", "Cross"]
var won := "" var won := ""
var five_wins = false
var count = 0 var count = 0
@ -68,12 +67,6 @@ func _check_win() -> String:
for check in _checks: for check in _checks:
for i in range(3): for i in range(3):
var same = true var same = true
if five_wins:
for j in range(5):
if board.get_state(cell + check[0] * (i + j)) != state:
same = false
break
else:
for j in range(4): for j in range(4):
if board.get_state(cell + check[0] * (i + j)) != state: if board.get_state(cell + check[0] * (i + j)) != state:
same = false same = false
@ -136,19 +129,3 @@ func _get_dice_pos_y(result: int) -> int:
6: return 410 6: return 410
return 410 return 410
#Nach dem Glücksradereignis wird die Siegesbedingung auf 5 gewinnt geändert
func _five_wins() -> void:
five_wins = true
#Nach dem Glücksradereignis tauschen die Spieler die Symbole
func _change_symbols() -> void:
current_player = 1 - current_player
nextPlayer.region_rect.position.x = current_player * 300
#Nach dem Glücksradereignis gewinnt der Spieler sofort
func _instant_win():
print("Winner: ", won)
wonPlayer.region_rect.position.x = player_states.find(won) * 300
wonPlayer.show()
nextPlayer.hide()
board.active = false