-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglyph.js
More file actions
22 lines (21 loc) · 751 Bytes
/
glyph.js
File metadata and controls
22 lines (21 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Game.Glyph = function(properties) {
// Instantiate properties to default if they weren't passed
properties = properties || {};
this._char = properties['character'] || ' ';
this._foreground = properties['foreground'] || 'white';
this._background = properties['background'] || '#080A1F';
};
// Create standard getters for glyphs
Game.Glyph.prototype.getChar = function(){
return this._char;
}
Game.Glyph.prototype.getBackground = function(){
return this._background;
}
Game.Glyph.prototype.getForeground = function(){
return this._foreground;
}
Game.Glyph.prototype.getRepresentation = function() {
return '%c{' + this._foreground + '}%b{' + this._background + '}' + this._char +
'%c{white}%b{black}';
};