mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-09-13 10:26:56 +00:00
Clarify energy cost with LEGS_SET_DIRECTION_AND_WALK, plus some small formatting changes
parent
1cfe7f960d
commit
d4f2cd0d47
@ -9,15 +9,18 @@ Hardware ID: `0x0001`
|
|||||||
### Interrupt Behavior
|
### Interrupt Behavior
|
||||||
| Value of A | Action | Energy cost | Result |
|
| Value of A | Action | Energy cost | Result |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| `1` | `LEGS_SET_DIRECTION` | `20 kJ` | Set the direction |
|
| `1` | `LEGS_SET_DIRECTION` | `20 kJ` | Turns the Cubot to face the [direction](#valid-directions) specified in register `B`. |
|
||||||
| `2` | `LEGS_SET_DIRECTION_AND_WALK` | `100 kJ` | Set the direction and walk forward |
|
| `2` | `LEGS_SET_DIRECTION_AND_WALK` | `100 kJ` | Moves the Cubot to face and walk in the [direction](#valid-directions) specified by register `B`. |
|
||||||
|
|
||||||
Specify the direction in the B register:
|
#### Valid directions
|
||||||
`NORTH` = `0x0000`
|
| Direction | Value |
|
||||||
`EAST` = `0x0001`
|
| :-------- | :------- |
|
||||||
`SOUTH` = `0x0002`
|
| North | `0x0000` |
|
||||||
`WEST` = `0x0003`
|
| East | `0x0001` |
|
||||||
|
| South | `0x0002` |
|
||||||
|
| West | `0x0003` |
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
Only one walk can be performed per tick, the last such `LEGS_SET_DIRECTION_AND_WALK` in the tick will be the one performed during the tick transition. `LEGS_SET_DIRECTION` may be performed multiple times during a tick.
|
- Only one walk can be performed per tick, the last such `LEGS_SET_DIRECTION_AND_WALK` in the tick will be the one performed during the tick transition. `LEGS_SET_DIRECTION` may be performed multiple times during a tick.
|
||||||
|
- Since only the last `LEGS_SET_DIRECTION_AND_WALK` in a tick will be performed, running the action does not immediately use energy, which means that using this action 5 times in one tick will not use `500 kJ` and instead consume `100 kJ` **at the end of the tick**. This is **not** true for `LEGS_SET_DIRECTION`, which will use energy immediately upon being ran.
|
Loading…
x
Reference in New Issue
Block a user