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