paint-by-numbers

Relaxing paint-by-numbers game  https://p.ce9e.org/paint-by-numbers/
git clone https://git.ce9e.org/paint-by-numbers.git

commit
dbeb7848359400bb6ebdf6da359648f90f46b63e
parent
88eb1272011d2bef38b76df8f06832a5189de595
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-02-12 19:24
reset speed when loading a new image

Diffstat

M paint.js 3 +++

1 files changed, 3 insertions, 0 deletions


diff --git a/paint.js b/paint.js

@@ -155,6 +155,9 @@ input.addEventListener('change', () => {
  155   155         dx = (canvas.width - offcanvas.width * zoom) / 2;
  156   156         dy = (canvas.height - offcanvas.height * zoom) / 2;
  157   157 
   -1   158         speed_x = 0;
   -1   159         speed_y = 0;
   -1   160 
  158   161         var x, y;
  159   162         for (y = 0; y < data.height; y++) {
  160   163             for (x = 0; x < data.width; x++) {