- [screwlisp proposes kittens](../..)
# Back of envelope game logic
Having [drafted counting sensors](../../lispgames/plant-sensors) I think we can just finish up game logic with a typecase basically. I have a little bit of time after planning for [Kent Pitman's interview tomorrow](../../show/urgent-kent-pitman-interview) (where he will read an unpublished essay live and share finding out about Ted Nelson /after/ writing his own Cross Referencing Editor Facility in England).
Here is my back-of-the-envelope draft of the game mechanic to implement.
## Basic mechanic
1. Call action on grid
2. randomly choose an entity from the grid's entityfile
3. Update that entity
- Plant has some chance to propagate
- - Checks sensors for plants
- - Propagates away from plants
- Insect tries to eat plants
- - Checks sensors for plants
- - spawns = moves towards plants
- - Eats a plant iff plant
- - - (Or has some probability of dying)
- Bird needs to eat and sleep
- - if hungry > tired
- - - tries to eat an insect iff insect
- - - - else chance of dying
- - - spawns ('moves' towards insects)
- - - low chance /not/ to remove the current position
- - - - i.e. the bird who moved away left an egg=new bird
- - else
- - - tries to sleep iff plant
- - - - else chance of dying
- - - else spawns (moves) towards plant
- - - - no chance of leaving an egg iff -plant