mr-crocs-adventures/js/module.js

17 lines
415 B
JavaScript

import RetroSprite from "./retro/RetroSprite.js";
let image = new Image();
image.src = 'graphics/mario.png';
image.onload = function () {
let sprite = new RetroSprite(image, 10);
let canvas = document.getElementById('canvas');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
let context = canvas.getContext('2d');
console.log(context);
sprite.draw(context);
};