Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-the-dev authored Apr 14, 2022
1 parent 6094487 commit bc17629
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Onitama was built using only vanilla Javascript (ES6) and CSS.

## Gameplay

In Onitama, users will be able to:
In Onitama, players can:
- Generate a random combination of (5) movement cards from the possible (16+)
- Select and move their pawns on the 5x5 grid
- Capture pawns (or be captured) as depicted in the movement cards
Expand All @@ -58,6 +58,40 @@ The 5 movement cards are a populated randomly from a total set of 16. As the mo
- Card selection highlights the active card that, when combined with a highlighted active pawn, depicts available moves as green spaces on the board.
- Opponent cards must be inverted and the movement pattern accurately depicted on the board for the current player's turn.

```JS
// Turn swap 'sleight of hand'

// Turn swap toggle is_flipped
async viewToggleFlipTurn() {
let that = this;

let turnCard = document.querySelector(".move-card .active-card");
turnCard.parentElement.classList.toggle("is_flipped");

let deckCard = document.querySelector("#on-deck-card");
deckCard.classList.toggle("is_flipped");
}

// Turn swap img trade
viewDealSwap(card, cardEl) {
let that = this;
// removes img from 'used' card
let child = cardEl.firstChild;
cardEl.removeChild(child);

// sets on deck img to 'used' card
let name = card[0].toLowerCase();
for (let i = 0; i < imgSources.length; i++) {
if (imgSources[i].includes(name)) {
let setBack = document.createElement("img");
setBack.className = "grid-graphic";
setBack.src = `${imgSources[i]}`;
cardEl.appendChild(setBack);
}
}
}
```

----

## Bonus
Expand Down

0 comments on commit bc17629

Please sign in to comment.