-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (37 loc) · 1 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Project } from "https://unpkg.com/leopard@^1/dist/index.esm.js";
import Stage from "./Stage/Stage.js";
import Player from "./Player/Player.js";
import Wall from "./Wall/Wall.js";
const stage = new Stage({ costumeNumber: 1 });
const sprites = {
Player: new Player({
x: 0,
y: 0,
direction: 90,
costumeNumber: 1,
size: 100,
visible: true
}),
Wall: new Wall({
x: -200,
y: 184,
direction: 90,
costumeNumber: 1,
size: 100,
visible: true
})
};
const project = new Project(stage, sprites);
export default project;
/*function() {
var canvas = document.getElementById('canvas'),
context = canvas.getContext('2d');
// Event handler to resize the canvas when the document view is changed
window.addEventListener('resize', resizeCanvas, false);
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// Redraw everything after resizing the window
drawStuff();
}
resizeCanvas();*/