ASCII Mario Game (HTML Canvas)

Text Views: 86 • Feb 08, 2026 • Never expires
10. ASCII Mario Game (HTML Canvas)
=================================

<canvas id="mario" width="400" height="200"></canvas>
<script>
const canvas = document.getElementById('mario');
const ctx = canvas.getContext('2d');
let x = 0;

function drawMario() {
  ctx.clearRect(0, 0, 400, 200);
  ctx.fillStyle = '#FF0000'; ctx.fillRect(x++, 150, 30, 50);
  ctx.fillStyle = '#000'; ctx.fillRect(x, 160, 10, 10); // Hat
  if (x > 370) x = 0;
  requestAnimationFrame(drawMario);
}
drawMario();
</script>
🛡️

Ad Blocker Detected

PasteBin.site is free to use thanks to our sponsors. Please consider disabling your ad blocker or whitelisting our site to support our servers.

Learn More