Workshop › Puzzle Bobble-style Bubble Shooter › Step 28 of 31
After the game, Space or a tap starts a new one. The tap only restarts; it does not also fire in the new game.
```js
else if (event.key === ' ') state === 'playing' ? shoot() : reset()
canvas.addEventListener('pointerdown', (event) => {
if (state === 'playing') pointAt(event)
})
// Lifting the finger shoots, or plays again after the end (so the tap that restarts does not also shoot).
canvas.addEventListener('pointerup', () => (state === 'playing' ? shoot() : reset()))
```keydown, change the Space line.pointerdown and pointerup lines with the new listeners and the comment.Skills: Keyboard and mouse input
← The end message Best score →