转变 API
通过Player.js
中的playTurn
方法,你可以创建一个回合的实例。 你在这个回合中可调用的方法取决于你当前战士的能力在哪个级别上。 请参阅配置文件目录中的README文件, 以查找该信息。
Here is an example extracted from the README of the second level in the "Baby Steps" tower:
### Abilities
#### Actions
- `warrior.attack()`
- `warrior.walk()`
#### Senses
- `warrior.feel()`
In this level, your warrior has the abilities "attack", "feel", and "walk", which means you can call these three methods on your turn: warrior.attack()
, warrior.feel()
, and warrior.walk()
.
Many abilities can be performed in the following directions: "forward", "backward", "left", and "right". You have to pass a string with the direction as the first argument, e.g.
warrior.walk('backward')
.