The Draw Module contains everything you need to set the pixels on the screen. This includes shapes, images, text, animations, and more.
The screen is 512 by 384 "art pixels" unless it's changed with setScreenSize(). The canvas is scaled up by a whole number so every art pixel stays crisp and square. All positions are in art pixels, with (0, 0) at the top left and y going down.
The Draw Module creates multiple canvases called "Layers." Layers are numbered, and higher layers are drawn on top of lower ones. At the end of every frame, all of the Layers are combined and drawn to the screen. Layers are not cleared on their own, so most games call clear() at the start of every tick.
Colors are strings like "#ff0000".
The Draw Module can be accessed with MDog.Draw.method().
Animations are made with the classes MDog.Draw.MultipleFileAnimation and MDog.Draw.SpriteSheetAnimation, and drawn with MDog.Draw.animation(). Every time an animation is drawn it moves forward by one tick, so draw it once per tick.
The animationSpeed is roughly how many frames are shown per second.
const run = new MDog.Draw.SpriteSheetAnimation("warrior/warrior-run-sheet.png", 8, 12, 64);
function main() {
MDog.Draw.clear();
MDog.Draw.animation(run, 100, 100);
}