sei-ec-remote / project-1-issues

Open new issues here
1 stars 2 forks source link

Animista and cssGame project issue #140

Closed melsil11 closed 2 years ago

melsil11 commented 2 years ago

What's the problem you're trying to solve?

using animista and getting images to move

Post any code you think might be relevant (one fenced block per file)

for ( let i = 0; i < choices.length; i++) {
        // used the shuffleArray function to create the face cards and ammend them to the html DOM
        if (choices[i] === 'faceCard1')   { 
            const card1 = document.createElement('img')
            card1.src = 'images/faceCard.jpeg'
            card1.style.width = '150px'
            card1.alt = 'faceCard1'
            card1.id = 'faceCard1'
            document.getElementsByClassName('cards')[0].appendChild(card1) 
            console.log('in shuffleArray conditional card1',document.getElementsByClassName('cards')[0]);

        } else if (choices[i] === 'faceCard2') {  
            const card2 = document.createElement('img')
            card2.src = 'images/faceCard.jpeg'
            card2.style.width = '150px'
            card2.alt = 'faceCard2'
            card2.id = 'faceCard2'
            document.getElementsByClassName('cards')[0].appendChild(card2) 
            console.log('in shuffleArray conditional card2',document.getElementsByClassName('cards')[0]);

        } else  {  
            const card3 = document.createElement('img')
            card3.src = 'images/faceCard.jpeg'
            card3.style.width = '150px'
            card3.alt = 'faceCard3'
            card3.id = 'faceCard3'
            document.getElementsByClassName('cards')[0].appendChild(card3) 
            console.log('in shuffleArray conditional card3',document.getElementsByClassName('cards')[0]);

        }
    console.log('in shuffleArray, choices',choices)
    }

If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?

What is your best guess as to the source of the problem?

I have no idea how to implement it

What things have you already tried to solve the problem?

I have googled and watched the two videos available and the one in spanish

Paste a link to your repository here[

](https://github.com/melsil11/Find-the-Puppy)

melsil11 commented 2 years ago

discussed how to use animista