summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-06-17 15:20:21 +0100
committerGitHub <noreply@github.com>2024-06-17 15:20:21 +0100
commit82f3d0c4741fcd7f255ccfc5f9c03c2502a6e4a8 (patch)
tree4b53d532d6d62d758682e1ab436105054ff9d92a /play.js
parent22797f1995f368ad1c57c9f93bf6bbdb30e36b78 (diff)
download1989-dawn-of-freedom-82f3d0c4741fcd7f255ccfc5f9c03c2502a6e4a8.tar.gz
Update play.js
All event cards moved to a single folder
Diffstat (limited to 'play.js')
-rw-r--r--play.js30
1 files changed, 8 insertions, 22 deletions
diff --git a/play.js b/play.js
index c2d11ed..9caf509 100644
--- a/play.js
+++ b/play.js
@@ -174,23 +174,13 @@ drawCards(deck, handLimit);
function displayHand(hand) {
const handDiv = document.getElementById('hand');
hand.forEach(card => {
- 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)
- }
- })
+ 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)
+ })
}
@@ -286,11 +276,7 @@ function playCard(event) {
const eventPanel = document.getElementById('events');
const activeCard = document.createElement('img')
- if (playedCard < 100) {
- activeCard.src = `cards/e${playedCard}.gif`
- } else {
- activeCard.src = `cards2/e${playedCard}.gif`
- }
+ activeCard.src = `cards/e${playedCard}.gif`
activeCard.className='playedCard'
activeCard.alt = `Card ${playedCard}`
eventPanel.appendChild(activeCard)