Lange Spieker: verschil tussen versies

Uit De FNM-wiki
Naar navigatie springen Naar zoeken springen
Geen bewerkingssamenvatting
Geen bewerkingssamenvatting
Regel 1: Regel 1:
h
h
h
h
h
h
h
h
<html>
<html>
<head>
<head>
Regel 15: Regel 5:
       margin: 0;
       margin: 0;
       padding: 0;
       padding: 0;
      overflow: hidden;
     }
     }
     #birdCanvas {
     #birdCanvas {
Regel 20: Regel 11:
       top: 0;
       top: 0;
       left: 0;
       left: 0;
       pointer-events: none; /* So it doesn't block clicks */
       pointer-events: none;
       z-index: -1; /* So it's behind other elements */
       z-index: -1;
     }
     }
   </style>
   </style>
Regel 31: Regel 22:
     const canvas = document.getElementById("birdCanvas");
     const canvas = document.getElementById("birdCanvas");
     const ctx = canvas.getContext("2d");
     const ctx = canvas.getContext("2d");
    let birdX = -50; // Start offscreen to the left
    const birdY = 300;
    const speed = 2;


     function drawLangeSpieker(x, y) {
     function drawLangeSpieker(x, y) {
Regel 84: Regel 79:
     }
     }


     drawLangeSpieker(250, 0);
     function animate() {
      ctx.clearRect(0, 0, canvas.width, canvas.height);
      drawLangeSpieker(birdX, birdY);
 
      birdX += speed;
      if (birdX > canvas.width + 50) {
        birdX = -50; // Loop back to start
      }
 
      requestAnimationFrame(animate);
    }
 
    animate();
   </script>
   </script>
</body>
</body>
</html>
</html>

Versie van 31 jul 2025 20:11