-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
61 lines (47 loc) · 1.34 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const canvas = document.querySelector('canvas');
canvas.width = 1024;
canvas.height = 576;
const C = canvas.getContext('2d');
const scaledCanvas = {
width: canvas.width / 4,
height: canvas.height / 4
}
const cameraEdges = {
right: canvas.width / 2,// /5 * 3,
left: canvas.width / 2,// /5 * 2,
top: canvas.height /5 * 3,
bottom: canvas.height /5 * 4
}
const possibleEnemies = [
Guiorg
];
document.addEventListener('DOMContentLoaded', function() {
Background.init();
Sounds.init();
Keys.monitor();
Engine.hero = new Player;
Engine.pet = new KarAMelo;
Scenario.setInitialBlock();
Scenario.createRandomPath();
Engine.load([
Background,
Scenario,
Engine.pet,
Engine.hero,
Hud
]);
InitScreen.init();
Engine.counterPlayTime = setInterval(() => {
if(Engine.running) {
Engine.playTime++;
}
}, 1000);
//Engine.run();
}, false);
console.warn('** CREDITS/THANKS TO **');
console.warn('Hero: https://rvros.itch.io/animated-pixel-hero');
console.warn('KarAMelo: https://free-game-assets.itch.io/free-street-animal-pixel-art-asset-pack');
console.warn('Monsters: https://luizmelo.itch.io/monsters-creatures-fantasy')
console.warn('Grass: https://szadiart.itch.io/pixel-dark-forest');
console.warn('Ammo: https://fightswithbears.itch.io/2d-health-and-ammo-pickups');
console.warn('Potion: https://cup-coffee.itch.io/pixel-assets');