.canvas {
background: url("../img/bg.jpg") no-repeat center;
display: block;
}
const canvas = document.querySelector("#canvas"),
ctx = canvas.getContext("2d");
// Set canvas width & height;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// show ground
const ground = new Image();
ground.src = "assets/img/ground.jpg";
ctx.drawImage(ground, 10, 10);