S SearchRSS
< BackHome
Newest questions tagged javascript - Stack Overflow

How do I do the vx = rightKey - leftKey * moveSpeed [closed]

I've been working on a simple puzzle platformer, and was trying to make the movement better, but my code: playerV.vx = (e.code === 'KeyD' - e.code === 'KeyA') * MOVE_SPEED was always putting 0 in the console, and the

View original source