mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Init
This commit is contained in:
17
js/module.js
Normal file
17
js/module.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
};
|
||||
Reference in New Issue
Block a user