-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclasses.js
More file actions
32 lines (29 loc) · 788 Bytes
/
classes.js
File metadata and controls
32 lines (29 loc) · 788 Bytes
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
function Point(x, y) {
const Point = {};
Point.x = x;
Point.y = y;
return Point;
}
class Log {
constructor() {
this._log = ( message, level, style ) => {
console.log( `%c${level}%c - ${message}`, style, "" );
};
this.DEBUG = ( message ) => {
this._log( message, "DEBUG", "color: blue" );
};
this.INFO = ( message ) => {
this._log( message, "INFO", "" );
};
this.WARNING = ( message ) => {
this._log( message, "WARNING", "color: yellow" );
};
this.ERROR = ( message ) => {
this._log( message, "ERROR", "color: red; font-weight: bold" );
};
}
}
function loadImage(scene, key, imageName) {
let cartographyPath = 'assets/cartographypack/PNG/Retina/'
scene.load.image(key, cartographyPath + imageName)
}