Skip to content

Instantly share code, notes, and snippets.

@cazala
Last active May 16, 2018 22:16
Show Gist options
  • Save cazala/71c26a6a265c844aa9cc3a260bfe014a to your computer and use it in GitHub Desktop.
Save cazala/71c26a6a265c844aa9cc3a260bfe014a to your computer and use it in GitHub Desktop.
// Sea
const { Sea } = require('shoaling')
const sea = new Sea(38, 1200, 300, 1200) // simulate 38 fish on a 'sea' of 1200x1200 (X and Z) and 300 deep (Y)
sea.start(64) // update every 64 milliseconds
setInterval(() => {
render(sea)
clients.forEach(client => client.forceUpdate())
}, 100) // render scene every 100 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment