-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.js
More file actions
41 lines (32 loc) · 886 Bytes
/
app.js
File metadata and controls
41 lines (32 loc) · 886 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
'use strict';
var b3 = require('./lib/behavior3js').b3;
var treeLoader = require('./lib/treeLoader');
treeLoader.init();
var ai = treeLoader.ai();
console.log('**** Lucky tries the door');
var lucky = {
memory: new b3.Blackboard()
};
lucky.memory.set('name', 'Lucky');
ai.guy.tick(lucky, lucky.memory);
console.log('');
console.log('**** Thief tries the door');
var thief = {
memory: new b3.Blackboard()
};
thief.memory.set('name', 'Thief');
thief.memory.set('locked', true);
thief.memory.set('lockpick-level', 8);
ai.guy.tick(thief, thief.memory);
console.log('');
console.log('**** Thug tries the door');
var thug = {
memory: new b3.Blackboard()
};
thug.memory.set('name', 'Thug');
thug.memory.set('locked', true);
thug.memory.set('lockpick-level', 2);
ai.guy.tick(thug, thug.memory);
console.log('');
console.log('');
console.log('**** Simulation complete');