Type: Animal Brain
Level: not in gallery
Pages: 2
Description: Found in the crow character. When a player approaches a crow it will fly away, and after 10 seconds (and out of sight) it will be destroyed.
Kode
page 1 @Idle and Takeoff
- WHEN [until][detect][player]
- …WHEN [countdown][5][loop] DO [play sound][sound:Animal Crow Call Single]
- WHEN [after][detect][player]
- …WHEN [once] DO [jump]
- …/…WHEN DO [play sound][sound:Animal Bird Wing Flaps]
- …/…WHEN DO [play fx][fx:Feather Burst]
- …WHEN DO [move]
- …WHEN [falling] DO [switch page][page:@Flight]
page 2 @Flight
- WHEN DO [move][with flying]
- WHEN DO [move][with flying][in direction][world up]
- WHEN [countdown timer][10] DO [destroy]
Alterations
Have bird return after flight.
page 1
Add above line 1
WHEN [page entered] DO [vectorvar:start position][equals][position]
Change line 6 to
…WHEN [started to] DO [jump]
page 2 Change line 4 to
WHEN [countdown timer][10] DO [switch page][page:@Return] // you can change the number as required
Add page 3 @Return
- WHEN [until][detect][player] DO [move][with flying][toward][vectorvar:start position]
- WHEN [detect player] DO [vectorvar:start position][x][equals][vecorvar:startposition][x][plus][1] // The crow will fly to an area away from the player if the player is still standing where the crow first flew from
- …WHEN DO [move][with flying][toward][vectorvar:start position]
- WHEN [no longer][detect][player] DO [fall]
- …WHEN DO [switch page][page:@Idle and Take Off]
- WHEN [distance to][vectorvar:startposition][less than][2][and][not][detect][player] DO [fall]
- …WHEN DO [switch page][page:@Idle and Take Off]