|
|
@ -51,11 +51,11 @@ impl Apr { |
|
|
|
let mut actors: Vec<actor::Actor> = Vec::new(); |
|
|
|
for i in 0..r { |
|
|
|
// white side
|
|
|
|
actors.push(actor::Actor::new(_ctx, "/pawn.png", i, 0, 0)); |
|
|
|
actors.push(actor::Actor::new(_ctx, "/pawn.png", i, 1, 0)); |
|
|
|
} |
|
|
|
for i in 0..r { |
|
|
|
// black side
|
|
|
|
actors.push(actor::Actor::new(_ctx, "/pawn2.png", i, c - 1, 0)); |
|
|
|
actors.push(actor::Actor::new(_ctx, "/pawn2.png", i, c - 2, 0)); |
|
|
|
} |
|
|
|
Ok(Apr { |
|
|
|
grid: make_grid(_ctx, r, c, board.board.as_slice())?, |
|
|
@ -63,9 +63,10 @@ impl Apr { |
|
|
|
should_update_grid: false, |
|
|
|
actors, |
|
|
|
dragging: false, |
|
|
|
behaviours: vec![behaviour::Behaviour { |
|
|
|
moves: vec![(0, 1)], |
|
|
|
}], //the pawn can go ONE forwards
|
|
|
|
behaviours: vec![behaviour::Behaviour { // 4-tile-corner leaper pawn behaviour
|
|
|
|
moves: vec![(1, 1)], |
|
|
|
dirs: (1, 0, 0, 0), |
|
|
|
}], //the pawn can go TWO diagonally and to the right and only upwards
|
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|