sei-ec-remote / project-1-issues

Open new issues here
1 stars 2 forks source link

Game project issue #135

Closed OHammerpaw closed 2 years ago

OHammerpaw commented 2 years ago

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

adding an event listener for mouse movement if certain text is displayed in message box

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

`const caughtCondition = () => {
    if(document.getElementById('message').innerText == "DON'T MOVE...") {
        game.addEventListener('mousemove', function(e) {
            ('message').innerText="You've been caught by the Mothman. Game Over."
    })
}`

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

Uncaught SyntaxError: Unexpected end of input (at index.js:293:1)

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

I think I have done something wonky and left out a parentheses or bracket

What things have you already tried to solve the problem?

I have added closing parentheses and closing bracket and still get the same error. I have been looking at this too long and just need a second pair of eyes

Paste a link to your repository here[

](https://github.com/OHammerpaw/The-Mothman)

OHammerpaw commented 2 years ago

I found where I messed up the missing bracket and parentheses, but I am still having trouble getting the mouse move event to work here. I have tried the eventListener and adding an event handler property. I am wondering if it is even possible to have two separate mouse move events happening on the same page.

OHammerpaw commented 2 years ago

Scarlet helped me figure out an alternative