Drawing should happen in layers (bg, hud, sprite1, sprite2).
This way, a dug out tile can draw in the background and not possibly overwrite the sprites. There's probably a drawing manager that draws each layer in the order (given above) calling functions passing in the 2d context from the canvas.
Calling draw() and passing in the drawmanager lets whatever it is add drawing functions that take the 2d context for each layer.
Drawing should happen in layers (bg, hud, sprite1, sprite2).
This way, a dug out tile can draw in the background and not possibly overwrite the sprites. There's probably a drawing manager that draws each layer in the order (given above) calling functions passing in the 2d context from the canvas.
Calling draw() and passing in the drawmanager lets whatever it is add drawing functions that take the 2d context for each layer.