Skip to content

tbillington/greenery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Greenery 🌳

Simple behavior trees.

const tree = select(
  endSimulation,
  sequence(
    moveInRange,
    select(
      shootEnemy,
      reload
    )
  )
)

const state = {
  player: { x: 5, bullets: 3 },  
  enemy: { x: 10, health: 10 },
  done: false
}

while (!state.done) {
  tree(state)
}