online multiplayer chess game (note server currently down)
first move thingy
bendn 2022-04-25
parent f311d7b · commit e7d7810
-rw-r--r--Piece.gd8
1 files changed, 5 insertions, 3 deletions
diff --git a/Piece.gd b/Piece.gd
index 45d8d1c..56218ca 100644
--- a/Piece.gd
+++ b/Piece.gd
@@ -42,15 +42,17 @@ func create_circles():
# for motion
match realname:
"pawn":
- var carray = [real_position - Vector2(0, 1)]
+ var carry = [real_position - Vector2(0, 1)]
if !has_moved:
- carray.append(real_position - Vector2(0, 2))
- set_circle(carray)
+ carry.append(real_position - Vector2(0, 2))
+ set_circle(carry)
func set_circle(positions: Array):
for i in range(len(positions)):
var pos = positions[i]
if Globals.grid.matrix[pos.y][pos.x]:
+ print(Globals.grid.matrix[pos.y][pos.x], " is in the way")
continue
+ print("creating circle at", pos)
Globals.grid.background_matrix[pos.x][pos.y].set_circle(true)