|
1 | 1 | # File name: Board.py |
| 2 | +####################################################################################################### |
| 3 | +#The Code is long, repetative and stringy but this is better than implementing it in python, |
| 4 | +#and the the best of my knowledge you have to keep each window in one file (multiple .kv files is okay) |
| 5 | +####################################################################################################### |
| 6 | + |
| 7 | + |
2 | 8 |
|
3 | 9 | <board_setup> |
4 | 10 | id: board_setup |
5 | 11 | canvas.before: |
| 12 | + #Makes a rectangle around the window, and fills that with the .PNG of the Chessbaord |
6 | 13 | Rectangle: |
7 | 14 | pos: self.pos |
8 | 15 | size: self.size |
9 | 16 | source: 'Pictures\chessboard.png' |
10 | 17 | FloatLayout: |
11 | | - |
| 18 | + #Size of each is 1/8 the total x and y value of the window |
12 | 19 | size_hint: .125, .125 |
13 | 20 |
|
| 21 | + ####Creates all of the White Pieces |
14 | 22 | Button: |
15 | 23 | id: "Left White Rook" |
16 | 24 | pos_hint: {"right": 1, 'y': 0} |
|
59 | 67 | background_normal: 'Pictures\White_Queen.png' |
60 | 68 | background_down: 'Pictures\White_Queen.png' |
61 | 69 |
|
62 | | - #ALL OF THE WHITE PAWNS: |
| 70 | + ###Creates all of the White Pawns |
63 | 71 |
|
64 | 72 | Button: |
65 | | - id: "Pawn1" |
| 73 | + id: "White Pawn1" |
66 | 74 | pos_hint: {"right": 1, 'y': 1} |
67 | 75 | background_down: 'Pictures\white_pawn.png' |
68 | 76 | background_normal: 'Pictures\white_pawn.png' |
69 | 77 |
|
70 | 78 | Button: |
71 | | - id: "Pawn2" |
| 79 | + id: "White Pawn2" |
72 | 80 | pos_hint: {"right": 2, 'y': 1} |
73 | 81 | background_down: 'Pictures\white_pawn.png' |
74 | 82 | background_normal: 'Pictures\white_pawn.png' |
75 | 83 |
|
76 | 84 | Button: |
77 | | - id: "Pawn3" |
| 85 | + id: "White Pawn3" |
78 | 86 | pos_hint: {"right": 3, 'y': 1} |
79 | 87 | background_down: 'Pictures\white_pawn.png' |
80 | 88 | background_normal: 'Pictures\white_pawn.png' |
81 | 89 |
|
82 | 90 | Button: |
83 | | - id: "Pawn4" |
| 91 | + id: "White Pawn4" |
84 | 92 | pos_hint: {"right": 4, 'y': 1} |
85 | 93 | background_down: 'Pictures\white_pawn.png' |
86 | 94 | background_normal: 'Pictures\white_pawn.png' |
87 | 95 |
|
88 | 96 | Button: |
89 | | - id: "Pawn5" |
| 97 | + id: "White Pawn5" |
90 | 98 | pos_hint: {"right": 5, 'y': 1} |
91 | 99 | background_down: 'Pictures\white_pawn.png' |
92 | 100 | background_normal: 'Pictures\white_pawn.png' |
93 | 101 |
|
94 | 102 | Button: |
95 | | - id: "Pawn6" |
| 103 | + id: "White Pawn6" |
96 | 104 | pos_hint: {"right": 6, 'y': 1} |
97 | 105 | background_down: 'Pictures\white_pawn.png' |
98 | 106 | background_normal: 'Pictures\white_pawn.png' |
99 | 107 |
|
100 | 108 | Button: |
101 | | - id: "Pawn7" |
| 109 | + id: "White Pawn7" |
102 | 110 | pos_hint: {"right": 7, 'y': 1} |
103 | 111 | background_down: 'Pictures\white_pawn.png' |
104 | 112 | background_normal: 'Pictures\white_pawn.png' |
105 | 113 |
|
106 | 114 | Button: |
107 | | - id: "Pawn8" |
| 115 | + id: "White Pawn8" |
108 | 116 | pos_hint: {"right": 8, 'y': 1} |
109 | 117 | background_down: 'Pictures\white_pawn.png' |
110 | 118 | background_normal: 'Pictures\white_pawn.png' |
| 119 | + |
| 120 | + ####################################### |
| 121 | + ########MOVED ONTO BLACK PIECES######## |
| 122 | + ###################################### |
| 123 | + |
| 124 | + Button: |
| 125 | + id: "Left Black Rook" |
| 126 | + pos_hint: {"right": 1, 'y': 7} |
| 127 | + background_normal: 'Pictures/black_rook.png' |
| 128 | + background_down: 'Pictures/black_rook.png' |
| 129 | + |
| 130 | + Button: |
| 131 | + id: "Right Black Rook" |
| 132 | + pos_hint: {"right": 8, 'y': 7} |
| 133 | + background_normal: 'Pictures/black_rook.png' |
| 134 | + background_down: 'Pictures/black_rook.png' |
| 135 | + |
| 136 | + Button: |
| 137 | + id: "Left Black Knight" |
| 138 | + pos_hint: {"right": 2, 'y': 7} |
| 139 | + background_normal: 'Pictures/black_horse.png' |
| 140 | + background_down: 'Pictures/black_horse.png' |
| 141 | + |
| 142 | + Button: |
| 143 | + id: "Right Black Knight" |
| 144 | + pos_hint: {"right": 7, 'y': 7} |
| 145 | + background_normal: 'Pictures/black_horse.png' |
| 146 | + background_down: 'Pictures/black_horse.png' |
| 147 | + |
| 148 | + Button: |
| 149 | + id: "Left Black Bishop" |
| 150 | + pos_hint: {"right": 3, 'y': 7} |
| 151 | + background_normal: 'Pictures/black_Bishop.png' |
| 152 | + background_down: 'Pictures/black_Bishop.png' |
| 153 | + |
| 154 | + Button: |
| 155 | + id: "Right Black Bishop" |
| 156 | + pos_hint: {"right": 6, 'y': 7} |
| 157 | + background_normal: 'Pictures/black_Bishop.png' |
| 158 | + background_down: 'Pictures/black_Bishop.png' |
| 159 | + |
| 160 | + Button: |
| 161 | + id: "Black King" |
| 162 | + pos_hint: {"right": 5, 'y': 7} |
| 163 | + background_normal: 'Pictures/black_king.png' |
| 164 | + background_down: 'Pictures/black_king.png' |
| 165 | + |
| 166 | + Button: |
| 167 | + id: "Black Queen" |
| 168 | + pos_hint: {"right": 4, 'y': 7} |
| 169 | + background_normal: 'Pictures/black_Queen.png' |
| 170 | + background_down: 'Pictures/black_Queen.png' |
| 171 | + |
| 172 | + ###Creates all of the Black Pawns |
| 173 | + |
| 174 | + Button: |
| 175 | + id: "Black Pawn1" |
| 176 | + pos_hint: {"right": 1, 'y': 6} |
| 177 | + background_down: 'Pictures/black_pawn.png' |
| 178 | + background_normal: 'Pictures/black_pawn.png' |
| 179 | + |
| 180 | + Button: |
| 181 | + id: "Black Pawn2" |
| 182 | + pos_hint: {"right": 2, 'y': 6} |
| 183 | + background_down: 'Pictures/black_pawn.png' |
| 184 | + background_normal: 'Pictures/black_pawn.png' |
| 185 | + |
| 186 | + Button: |
| 187 | + id: "Black Pawn3" |
| 188 | + pos_hint: {"right": 3, 'y': 6} |
| 189 | + background_down: 'Pictures/black_pawn.png' |
| 190 | + background_normal: 'Pictures/black_pawn.png' |
| 191 | + |
| 192 | + Button: |
| 193 | + id: "Black Pawn4" |
| 194 | + pos_hint: {"right": 4, 'y': 6} |
| 195 | + background_down: 'Pictures/black_pawn.png' |
| 196 | + background_normal: 'Pictures/black_pawn.png' |
| 197 | + |
| 198 | + Button: |
| 199 | + id: "Black Pawn5" |
| 200 | + pos_hint: {"right": 5, 'y': 6} |
| 201 | + background_down: 'Pictures/black_pawn.png' |
| 202 | + background_normal: 'Pictures/black_pawn.png' |
| 203 | + |
| 204 | + Button: |
| 205 | + id: "Black Pawn6" |
| 206 | + pos_hint: {"right": 6, 'y': 6} |
| 207 | + background_down: 'Pictures/black_pawn.png' |
| 208 | + background_normal: 'Pictures/black_pawn.png' |
| 209 | + |
| 210 | + Button: |
| 211 | + id: "Black Pawn7" |
| 212 | + pos_hint: {"right": 7, 'y': 6} |
| 213 | + background_down: 'Pictures/black_pawn.png' |
| 214 | + background_normal: 'Pictures/black_pawn.png' |
| 215 | + |
| 216 | + Button: |
| 217 | + id: "Black Pawn8" |
| 218 | + pos_hint: {"right": 8, 'y': 6} |
| 219 | + background_down: 'Pictures/black_pawn.png' |
| 220 | + background_normal: 'Pictures/black_pawn.png' |
0 commit comments