online multiplayer chess game (note server currently down)
Diffstat (limited to 'pieces/Piece.gd')
-rw-r--r--pieces/Piece.gd6
1 files changed, 4 insertions, 2 deletions
diff --git a/pieces/Piece.gd b/pieces/Piece.gd
index 9570ac1..bb9604b 100644
--- a/pieces/Piece.gd
+++ b/pieces/Piece.gd
@@ -38,7 +38,6 @@ func clear_clicked():
func move(newpos: Vector2): # dont use directly; use moveto
- has_moved = true
tween.interpolate_property(
self,
"global_position",
@@ -58,6 +57,7 @@ func moveto(position, real = true):
if real:
real_position = position
move(position)
+ has_moved = true
func pos_around(around_vector):
@@ -96,7 +96,7 @@ func traverse(arr = [Vector2.UP, Vector2.DOWN, Vector2.LEFT, Vector2.RIGHT]):
return circle_array
-func at_pos(vector):
+func at_pos(vector: Vector2):
return Globals.grid.matrix[vector.y][vector.x]
@@ -174,6 +174,8 @@ func take(piece: Piece):
func took(): # called when piece is taken
+ print(shortname, "was killed")
+ Globals.grid.matrix[real_position.y][real_position.x] = null
anim.play("Take")