HTML5 Game - Canvas Shape Pacman

Description

Pacman

Demo

ResultView the demo in separate window

<!doctype html>
<html>
  <head>
    <title>Pacmania</title>
  </head>// w  ww.  jav  a2s .co m
  <body>
    <h1>Pac-man</h1>
    <canvas id="pacmania" width="400" height="400"></canvas>
    <script>
      let context = document.getElementById("pacmania").getContext("2d");
      context.beginPath();
      context.arc(200, 200, 150, 0.2 * Math.PI, 1.8 * Math.PI);
      context.lineTo(200, 200);
      context.fillStyle = "yellow";
      context.fill();
    </script>
  </body>
</html>

Related Topics