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
25
26
27
28
extends Piece
class_name King


func get_moves():
	var moves = [
		pos_around(Vector2.UP),
		pos_around(Vector2.DOWN),
		pos_around(Vector2.LEFT),
		pos_around(Vector2.RIGHT),
		pos_around(Vector2(1, 1)),
		pos_around(Vector2(1, -1)),
		pos_around(Vector2(-1, 1)),
		pos_around(Vector2(-1, -1))
	]
	var final = []
	for i in moves:
		if is_on_board(i):
			if check_spots_check:
				if !checkcheck(i):
					continue
			final.append(i)
	return final


func _ready():
	._ready()
	shortname = "k" + team