<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canvas - creeper</title>
<style>
body{
display: flex;
justify-content: center;
}
canvas{
background-color: #04582e;
}
</style>
</head>
<body>
<canvas width="350" height="300" style="border: 1px solid #000;"></canvas>
<script>
let lienzo = document.querySelector("canvas");
let ctx = lienzo.getContext("2d");
ctx.beginPath();
ctx.fillStyle = "black";
ctx.fillRect(40,50,100,100);
ctx.fillRect(220,50,100,100);
ctx.fillRect(140,150,80,50);
ctx.fillRect(100,200,160,50);
ctx.fillRect(100,250,40,50);
ctx.fillRect(220,250,40,50);
ctx.closePath();
</script>
</body>
</html>