learn-co-curriculum / javascript-rock-dodger

Other
4 stars 56 forks source link

IDE test passes || game works in browser #31

Open joanrig opened 5 years ago

joanrig commented 5 years ago

`function moveDodger(e) { if (e.which === LEFT_ARROW) { moveDodgerLeft(); //e.stopPropagation(); //e.preventDefault(); }

if (e.which == RIGHT_ARROW) { moveDodgerRight(); //e.stopPropagation(); //e.preventDefault(); } }`

joanrig commented 5 years ago

in the code snippet, i had to comment out the e.stopPropagation(); and e.preventDefault(); to get game to work in browser.

with those lines, the dodger can't move left or right -- ie the default action of left and right arrow key is prevented?