Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.
/ foodchain Public archive

A predator-prey simulation programmed with the p5.js library.

License

Notifications You must be signed in to change notification settings

selenebun/foodchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foodchain

A predator-prey simulation in p5.js that can be played here.

Controls:

If you do not have a keyboard, a menu may be used inside the simulation.

  • Mouse to place a creature
  • Alt to toggle avoidance lines
  • Ctrl to toggle perception visualization
  • Enter to clear the screen
  • Spacebar to toggle targeting lines
  • 0-9 to select a preset
  • G to toggle species pie chart
  • M to cycle between display modes (dark mode, line mode)
  • N to toggle fading based on nutrition level
  • O to toggle motion blur
  • Q to toggle menu visibility

Creature types:

Press one of these keys to select a creature, then place with the mouse:

  • B = prey
  • F = food
  • H = hive
  • P = predator
  • S = swarm
  • V = fungus