Les comparto mi codigo el cual permite que aunque se cambie el tam;o de canva se amntenga centrado y en proporción el creeper
<canvas height="400" width="600">
</canvas>
<script>
function centerRec (recArr){
recArr[2] = screenDim[0]/2-recArr[0]/2;
recArr[3] = screenDim[1]/2-recArr[1]/2;
}
var pantalla = document.querySelector('canvas');
var pincel = pantalla.getContext('2d');
const screenDim = [
parseInt(pantalla.getAttribute('width')),
parseInt(pantalla.getAttribute('height'))
];
var faceDim = [350,300];
centerRec(faceDim);
var eyesDim = [90,90];
var noseDim = [70,100];
var moustacheDim = [40,110]
pincel.fillStyle = 'white';
pincel.fillRect(0,0,screenDim[0],screenDim[1]);
pincel.fillStyle = 'darkgreen';
pincel.fillRect(faceDim[2],faceDim[3],faceDim[0],faceDim[1]);
pincel.fillStyle = 'black';
pincel.fillRect(//moustache 1
faceDim[2]+faceDim[0]/2-noseDim[0]/2-moustacheDim[0],
faceDim[3]+faceDim[1]-moustacheDim[1],
moustacheDim[0],
moustacheDim[1]
);
pincel.fillRect(//moustache 2
faceDim[2]+faceDim[0]/2+noseDim[0]/2,
faceDim[3]+faceDim[1]-moustacheDim[1],
moustacheDim[0],
moustacheDim[1]
);
pincel.fillRect(//nose
faceDim[2]+faceDim[0]/2-noseDim[0]/2,
faceDim[3]+faceDim[1]-moustacheDim[1]-noseDim[1]/2,
noseDim[0],
noseDim[1]
);
pincel.fillRect(//eye 1
faceDim[2]+faceDim[0]/2-noseDim[0]/2-eyesDim[0],
faceDim[3]+faceDim[1]-moustacheDim[1]-noseDim[1]/2-eyesDim[1],
eyesDim[0],
eyesDim[1]
);
pincel.fillRect(//eye 2
faceDim[2]+faceDim[0]/2-noseDim[0]/2+noseDim[0],
faceDim[3]+faceDim[1]-moustacheDim[1]-noseDim[1]/2-eyesDim[1],
eyesDim[0],
eyesDim[1]
);
</script>