diff options
-rw-r--r-- | play.js | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -33,6 +33,7 @@ let czechHeld=0 let hungaryHeld=0
let romaniaHeld=0
let bulgariaHeld=0
+let presidentialVisit=0
const countryNames= [
@@ -147,7 +148,7 @@ function createMap() { const handLimit = 8;
-const comHandLimit = 8; //Will be needed for Presidential Visit
+const comHandLimit = 8 + presidentialVisit;
const hand =[];
const discard =[];
@@ -173,12 +174,22 @@ drawCards(deck, handLimit); function displayHand(hand) {
const handDiv = document.getElementById('hand');
hand.forEach(card => {
- const img = document.createElement('img')
- img.src = `images/e${card}.gif`
- img.className='handCard'
- img.alt = `Card ${card}`
- img.addEventListener('click', playCard)
- handDiv.appendChild(img)
+ if (card < 100) {
+ const img = document.createElement('img')
+ img.src = `cards/e${card}.gif`
+ img.className='handCard'
+ img.alt = `Card ${card}`
+ img.addEventListener('click', playCard)
+ handDiv.appendChild(img)
+ }
+ else {
+ const img = document.createElement('img')
+ img.src = `cards2/e${card}.gif`
+ img.className='handCard'
+ img.alt = `Card ${card}`
+ img.addEventListener('click', playCard)
+ handDiv.appendChild(img)
+ }
})
}
|