Bird

Type: Animal Brain
Level: 3 star
Pages: 2
Description: The default brain for most bird characters. The bird will sit and wait until it detects an enemy or a player, and then it will fly up into the air for 10 seconds and then will disappear.

Kode

page 1 @Detect – Switch Page

  1. WHEN [for each of][detect]
  2. …WHEN [it][team][not equal to][neutral] DO [switch page][@Fly]

page 2 @Fly

  1. WHEN [until][falling]
  2. …WHEN [once] DO [jump]
  3. …/…WHEN [play sound][sound:animal Bird Wing]
  4. …/…WHEN DO [play fx][fx:Feather burst]
  5. …WHEN DO [move]
  6. WHEN [after][falling]
  7. …WHEN DO [move][with flying]
  8. …WHEN DO [move][with flying][in direction][world up]
  9. …WHEN [countdown timer][10] DO [destroy]

 

Alterations

Make the bird fly around and return
To make a more realistic bird, which is not destroyed in the air I had a play with the kode. It is not doing what I was planning for it to do, but the effect is pretty good, and makes for a realistic bird behaviour. The bird flies into the area circles and spirals down to the ground again.

page 2

  1. WHEN [until][falling]
  2. …WHEN [started to] DO [jump] // Note the change from the [once] tile
  3. …/…WHEN [play sound][sound:animal Bird Wing]
  4. …/…WHEN DO [play fx][fx:Feather burst]
  5. …WHEN DO [move]
  6. WHEN [after][falling]
  7. …WHEN DO [move][with flying]
  8. …WHEN [duration timer][2] DO [move][with flying][in direction][world up]
  9. …WHEN [countdown timer][2] DO [move][with flying][at speed][0.5][toward][zero]
  10. …/…WHEN [bump terrain][or][countdown timer][5] DO [fall]
  11. …/…/…WHEN DO [switch page][page: @ Detect – Switch Page]
  12.  

 

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: