Manca ctx.beginPath() prima di iniziare il disegno della pallina rossa (all'inizio della funzione disegna() ).
Come scritto qui: https://developer.mozilla.org/en-US/...xt2D/clearRect
Note: Be aware that clearRect() may cause unintended side effects if you're not using paths properly. Make sure to call beginPath() before starting to draw new items after calling clearRect().
Ciao.![]()