Commit | Line | Data |
---|---|---|
1 | export default function (color, initRank) { | |
2 | ||
3 | const pawnShift = (color == "w" ? -1 : 1); | |
4 | return { | |
5 | "class": "pawn", | |
6 | moves: [ | |
7 | { | |
8 | steps: [[pawnShift, 1], [pawnShift, -1]], | |
9 | range: (initRank ? 2 : 1) | |
10 | } | |
11 | ], | |
12 | attack: [ | |
13 | { | |
14 | steps: [[pawnShift, 0]], | |
15 | range: 1 | |
16 | } | |
17 | ] | |
18 | }; | |
19 | ||
20 | } |