Skip to content

Commit

Permalink
docs(docs): add a simple usage
Browse files Browse the repository at this point in the history
  • Loading branch information
robinxb committed Jun 4, 2019
1 parent d39bedd commit 6ff52b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ You can get release versions of these from [releases page](https://github.com/ro

You can find examples from [test/BehaviorTreeBuilder.test.ts](https://github.com/robinxb/ts-behavior-tree/blob/master/test/BehaviorTreeBuilder.test.ts).

Here is a simple usage

```javascript
import { BehaviorTreeBuilder, BehaviorTreeStatus, TimeData } from 'ts-behavior-tree'
const node = new BehaviorTreeBuilder()
.Sequence('aa')
.Do('aa', () => BehaviorTreeStatus.Failure)
.End()
.Build()
console.log(node.Tick(new TimeData()) === BehaviorTreeStatus.Failure)
```


## Development

Expand Down

0 comments on commit 6ff52b1

Please sign in to comment.