mr-crocs-adventures/js/module.js

17 lines
415 B
JavaScript
Raw Normal View History

2020-01-19 00:45:17 +01:00
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);
};