-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreep.js
More file actions
43 lines (31 loc) · 860 Bytes
/
Creep.js
File metadata and controls
43 lines (31 loc) · 860 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
33
34
35
36
37
38
39
40
41
42
43
var behaviours = require('behaviours');
module.exports = (function(){
var data = {
Harvester: Harvester,
Guard: Guard
}
return data;
function Harvester(name){
var harvester = CreepAbstract(name)
harvester.role = 'harvester';
harvester.max = 2;
harvester.body = [Game.MOVE, Game.CARRY, Game.WORK];
return harvester;
}
function Guard(name){
var guard = CreepAbstract(name);
guard.role = 'guard';
guard.max = 2;
guard.body = [Game.MOVE, Game.CARRY, Game.WORK];
return guard;
}
function CreepAbstract(name){
var creep = {
name: name,
role: '',
max: 0,
body: []
}
return creep;
}
})();