online multiplayer chess game (note server currently down)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extends Piece
class_name Knight, "res://assets/pieces/california/wN.png"


func get_moves() -> Array:
	var moves := [
		pos_around(Vector2(-2, -1)),
		pos_around(Vector2(-2, 1)),
		pos_around(Vector2(2, -1)),
		pos_around(Vector2(2, 1)),
		pos_around(Vector2(-1, -2)),
		pos_around(Vector2(1, -2)),
		pos_around(Vector2(-1, 2)),
		pos_around(Vector2(1, 2))
	]
	var final := []
	for i in moves:
		if is_on_board(i):
			if no_enemys and at_pos(i):
				continue
			if check_spots_check and checkcheck(i):
				continue
			final.append(i)
	return final