From 5a6367079a38ffdf36b293a753ef18377efb7444 Mon Sep 17 00:00:00 2001 From: javier-barea Date: Wed, 9 Sep 2020 18:04:19 -0500 Subject: [PATCH 1/2] Define user instructions #3 --- src/module/lang.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/module/lang.js diff --git a/src/module/lang.js b/src/module/lang.js new file mode 100644 index 0000000..119ed1d --- /dev/null +++ b/src/module/lang.js @@ -0,0 +1,16 @@ +import { GameState } from './util.js' + +/** + * Enum of all possible instructions. + * @type {object} + */ +const instructions = { + [GameState.ChoosingNumberOfShips]: 'Select the number of ships ', + [GameState.PlayerSetup]: 'Place your ships on the grid', + [GameState.PromptPlayerChange]: "It is your opponent's turn", + [GameState.PlayerTurn]: 'Select a cell to fire a missile', + [GameState.PlayerVictory]: 'You won!' + // and so on +} + +export { instructions } \ No newline at end of file From 19aa3733d0604f37e6875b825eb51ccd4092d4c4 Mon Sep 17 00:00:00 2001 From: javier-barea Date: Wed, 9 Sep 2020 18:24:54 -0500 Subject: [PATCH 2/2] Add definition for ship options #1 --- src/components/TopLevel.component.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/TopLevel.component.js b/src/components/TopLevel.component.js index 437c130..644880b 100644 --- a/src/components/TopLevel.component.js +++ b/src/components/TopLevel.component.js @@ -12,7 +12,6 @@ const template = ` -
@@ -60,20 +59,22 @@ export default class TopLevelComponent extends Component { ship1(){ game_service.advance_game_state() + game_service.set_n_boats(1) } ship2(){ game_service.advance_game_state() + game_service.set_n_boats(2) } ship3(){ game_service.advance_game_state() + game_service.set_n_boats(3) } ship4(){ game_service.advance_game_state() + game_service.set_n_boats(4) } ship5(){ game_service.advance_game_state() + game_service.set_n_boats(5) } - bypass() { - game_service.advance_game_state() - } -} +