diff --git a/assets/export/edge.png.import b/assets/export/edge.png.import new file mode 100644 index 0000000..d6ac650 --- /dev/null +++ b/assets/export/edge.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/edge.png-f8eb0bb54aa0cd5dd98a7aca825fc2d4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/export/edge.png" +dest_files=[ "res://.import/edge.png-f8eb0bb54aa0cd5dd98a7aca825fc2d4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/src/Game.gd b/src/Game.gd index b224cbe..d705fc1 100644 --- a/src/Game.gd +++ b/src/Game.gd @@ -65,7 +65,13 @@ func get_valid_piece_moves(piece): # @TODO Filter based on game state var moves = [] for m in possible_moves: - var target_square = self.board_squares[m['pos']] + var target_square = null + if self.board_squares.has(m['pos']): + target_square = self.board_squares[m['pos']] + if target_square == null: + # Move it off the board + print("Move to ", m['pos'], " is not valid due to not being on the board") + continue if target_square['piece']: # something here if pieces_hostile(piece, target_square['piece']):