-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdn.js
40 lines (35 loc) · 1.09 KB
/
dn.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
/*global ROT, DN*/
var Dn = function () {
'use strict';
this.display = new ROT.Display({
fontFamily: 'Courier'
});
this.digger = new ROT.Map.Digger(60, 20);
this.scheduler = new ROT.Scheduler.Speed();
this.engine = new ROT.Engine(this.scheduler);
this.levels = [];
this.adventurer = {};
};
Dn.prototype.init = function () {
'use strict';
this.adventurer = new DN.Actor();
DN.levels.push(new DN.Level());
this.engine.start();
};
Dn.prototype.drawUI = function () {
'use strict';
this.display.drawText(1, 21, 'Welcome to the Dungeons of Neverknown!');
this.display.drawText(62, 0, 'Health: ' + this.adventurer.currentHealth + '/'
+ this.adventurer.maxHealth);
this.display.drawText(62, 2, '@ adventurer');
this.display.drawText(62, 3, '. floor');
this.display.drawText(62, 4, '+ closed door');
this.display.drawText(62, 5, '/ opened door');
this.display.drawText(62, 6, '# wall');
this.display.drawText(62, 7, '> stairs');
};
Dn.prototype.getLevel = function () {
'use strict';
return this.levels[this.adventurer.z];
};
var DN = new Dn();