diff --git a/game/src/consts.rs b/game/src/consts.rs index 118b5db..1a86014 100644 --- a/game/src/consts.rs +++ b/game/src/consts.rs @@ -4,8 +4,8 @@ pub const PLAYER_DUSK :u8 = 1; pub const PIECES_COUNT :usize = 7; pub const PIECE_NONE :u8 = PIECES_COUNT as u8 + 1; pub const PIECE_MILITIA :u8 = 0; -pub const PIECE_KNIGHT :u8 = 1; -pub const PIECE_LANCE :u8 = 2; +pub const PIECE_LANCE :u8 = 1; +pub const PIECE_KNIGHT :u8 = 2; pub const PIECE_TOWER :u8 = 3; pub const PIECE_CASTLE :u8 = 4; pub const PIECE_DRAGON :u8 = 5; diff --git a/game/src/piece/mod.rs b/game/src/piece/mod.rs index bdef94d..3b1b867 100644 --- a/game/src/piece/mod.rs +++ b/game/src/piece/mod.rs @@ -37,17 +37,6 @@ pub const PIECES :[PieceClass; PIECES_COUNT] = [ stride:0, }, }, - PieceClass { - name: "Knight", - moves: MoveSet { - direction:bit(3) | bit(6) | bit(11) | bit(13) | bit(17), - stride:0, - }, - pmoves: MoveSet{ - direction:bit(3) | bit(6) | bit(7) | bit(10) | bit(11) | bit(13) | bit(14) | bit(16) | bit(17), - stride:0, - }, - }, PieceClass { name: "Lance", moves: MoveSet { @@ -59,6 +48,17 @@ pub const PIECES :[PieceClass; PIECES_COUNT] = [ stride:0, }, }, + PieceClass { + name: "Knight", + moves: MoveSet { + direction:bit(3) | bit(6) | bit(11) | bit(13) | bit(17), + stride:0, + }, + pmoves: MoveSet{ + direction:bit(3) | bit(6) | bit(7) | bit(10) | bit(11) | bit(13) | bit(14) | bit(16) | bit(17), + stride:0, + }, + }, PieceClass { name: "Tower", moves: MoveSet { diff --git a/www/js/game.js b/www/js/game.js index 54e3c6c..79d8756 100644 --- a/www/js/game.js +++ b/www/js/game.js @@ -560,8 +560,8 @@ GAME.Const = { PieceId: { Militia: 0, - Knight: 1, - Lance: 2, + Lance: 1, + Knight: 2, Tower: 3, Castle: 4, Dragon: 5, @@ -583,6 +583,20 @@ GAME.Const = { .add(4) .add(5), ), + new GAME.GamePiece( + "Lance", + new GAME.PieceMovement() + .add_stride(0) + .add(1) + .add(5), + new GAME.PieceMovement() + .add(0) + .add(1) + .add(2) + .add(3) + .add(4) + .add(5), + ), new GAME.GamePiece( "Knight", new GAME.PieceMovement() @@ -615,20 +629,6 @@ GAME.Const = { .add(22) .add(23), ), - new GAME.GamePiece( - "Lance", - new GAME.PieceMovement() - .add_stride(0) - .add(1) - .add(5), - new GAME.PieceMovement() - .add(0) - .add(1) - .add(2) - .add(3) - .add(4) - .add(5), - ), new GAME.GamePiece( "Tower", new GAME.PieceMovement() diff --git a/www/js/game_asset.js b/www/js/game_asset.js index af24a8b..e163edf 100644 --- a/www/js/game_asset.js +++ b/www/js/game_asset.js @@ -10,8 +10,8 @@ GAME_ASSET.Image = { Promote: GAME_ASSET.load_image("asset/promote.svg"), Piece: [ [ GAME_ASSET.load_image("asset/militia_dawn.svg"), GAME_ASSET.load_image("asset/militia_dusk.svg") ], - [ GAME_ASSET.load_image("asset/knight_dawn.svg"), GAME_ASSET.load_image("asset/knight_dusk.svg") ], [ GAME_ASSET.load_image("asset/lance_dawn.svg"), GAME_ASSET.load_image("asset/lance_dusk.svg") ], + [ GAME_ASSET.load_image("asset/knight_dawn.svg"), GAME_ASSET.load_image("asset/knight_dusk.svg") ], [ GAME_ASSET.load_image("asset/tower_dawn.svg"), GAME_ASSET.load_image("asset/tower_dusk.svg") ], [ GAME_ASSET.load_image("asset/castle_dawn.svg"), GAME_ASSET.load_image("asset/castle_dusk.svg") ], [ GAME_ASSET.load_image("asset/dragon_dawn.svg"), GAME_ASSET.load_image("asset/dragon_dusk.svg") ],