Skip to content

Commit

Permalink
MNG-127 Improve game logs + change font of active player (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandraCyp authored Feb 13, 2021
1 parent b14bb21 commit fdb38a2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fightPage/createActivePlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const createActivePlayer = (gameHandler: GameHandler) => {
const activePlayerArea = document.querySelector(
"#active-player-info"
) as HTMLDivElement;
activePlayerArea.textContent = `${gameHandler.currentPlayer.name} now is your turn. Get the revenge!`;
activePlayerArea.innerHTML = `<span>${gameHandler.currentPlayer.name}</span> now is your turn. Get the revenge!`;
const playerOneUnderlineArea = document.querySelector("#fight-page-player1");
const playerTwoUnderlineArea = document.querySelector("#fight-page-player2");
const underlineOne = document.querySelector("#underline1") as HTMLDivElement;
Expand Down
4 changes: 4 additions & 0 deletions src/fightPage/updateMovesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ export const updateMovesList = (
const pokemonName = gameHandler.currentPlayer.getActivePokemon.name;
const buttonContent = (event.currentTarget as HTMLDivElement).textContent;
const playerName = gameHandler.currentPlayer.name;
const opponentPlayerPokemonName = gameHandler.opponentPlayer.getActivePokemon.name;
switch (calledFunction) {
case attack:
newMoveText.nodeValue = `${playerName}: ${pokemonName} used ${buttonContent}!`;
if (!gameHandler.opponentPlayer.getActivePokemon.isAlive()) {
newMoveText.nodeValue += ` ${opponentPlayerPokemonName} is defeated!`;
}
break;
case switchPoke:
newMoveText.nodeValue = `${playerName} changed Pokemon: ${pokemonName} comes into play!`;
Expand Down
4 changes: 4 additions & 0 deletions styles/SASS/_fight-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
width: 80%;
font-size: 1.8rem;
margin: 25px auto;

span {
font-family: 'Pokemon Solid';
}
}

.battleArea {
Expand Down
4 changes: 4 additions & 0 deletions styles/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion styles/app.css.map

Large diffs are not rendered by default.

0 comments on commit fdb38a2

Please sign in to comment.