cyu72 / 8bitGames

0 stars 0 forks source link

[spaceInvaders] Ship on skates #12

Open cyu72 opened 1 year ago

cyu72 commented 1 year ago

The ship starts gliding after multiple inputs when I add props.setGunTipY in a useEffect hook. Possibility that its affecting the original setNextPosX value?

cyu72 commented 1 year ago

Everytime you press an arrow key, it adds another input on top of your next input. Eg. Click left arrow 1, it counts once, click it again, it counts twice despite one click.

The issue may lie in how many useEffects I have, but still not sure why adding setGunTipY sets it overboard.