{"_id":"pour","_rev":"11-71fb611abbeab4015fae69cdfab3a5cd","name":"pour","time":{"modified":"2022-06-24T12:15:21.457Z","created":"2014-02-04T18:52:58.738Z","0.0.0":"2014-02-04T18:52:58.739Z","0.2.0":"2015-06-17T20:08:51.079Z","0.2.1":"2015-08-01T03:53:13.182Z","0.3.0":"2016-01-16T12:25:13.952Z"},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"dist-tags":{"latest":"0.3.0"},"description":"pour is lightweight particle system.","readme":"# pour\n\n[![npm version](https://img.shields.io/npm/v/pour.svg)](https://www.npmjs.com/package/pour)\n[![bower version](https://img.shields.io/bower/v/pour.svg)](bower.json)\n[![build status](https://img.shields.io/travis/derhuerst/pour.svg)](https://travis-ci.org/derhuerst/pour)\n[![dev dependency status](https://img.shields.io/david/dev/derhuerst/pour.svg)](https://david-dm.org/derhuerst/pour#info=devDependencies)\n\n***pour* is a lightweight JavaScript particle system** able to simulate **particles, emitters and fields**. It is flexible because it has **no rendering code** and works **step-based** instead of time-based.\n\n*pour* has a simple and straightforward API and embraces [prototypal programming](http://davidwalsh.name/javascript-objects-deconstruction#simpler-object-object), keeping it **below 4kb (minified)**. In addition, it supports both browser- and node-based environments. *pour* is licensed under the **[MIT license](LICENSE)**.\n\n\n\n## Install\n\nIf you want to go with the **default build**, download the latest release from [the releases page](https://github.com/derhuerst/pour/releases). **The JavaScript files will be in the `dist` folder.**\n\n\n## Getting Started\n\nLet's simulate the path of a particle being attracted by a field.\n\nTo begin, we set up an empty particle system. A `System` holds all `Particle`s, `Emitter`s and `Field`s together.\n\n```javascript\nvar system = pour.s();    // shorthand for `new pour.System()`\n```\n\nWe also set up an `Emitter` that emits `Particle`s and add it to our `System`.\n\n```javascript\nvar emitter = pour.e({    // shorthand for `new pour.Emitter(…)`\n\tposition: new pour.Vector(250, 250),\t// the position of the emitter\n\tvelocity: new pour.Vector(1, 0),\t\t// the direction & velocity of the particles\n\tspread: Math.PI / 4\t\t\t\t\t\t// 45 degrees spread (in radians)\n});\nsystem.add(emitter);\n```\n\nEverytime we call `emit`, the `Emitter` emits a new `Particle`.\n\n```javascript\nvar particle = emitter.emit();\n```\n\nIf we add the `Particle` to the `System`, we can compute its path by calling `system.tick()`. Each call to `tick` simulates one atomic step. All `Particle`s will then move according to their current `velocity`.\n\n```javascript\nsystem.add(particle);\nsystem.tick();    // one step further…\n```\n\nBy adding a `Field`, we can influence all `Particle`s in our `System`. A positive `mass` of a `Field` will attract them, a negative will repulse them.\n\n```javascript\nfield = pour.f({    // shorthand for `new pour.Field(…)`\n\tposition: pour.v(100, 50)    // shorthand for `new pour.Vector(…)`\n});\nsystem.add(field);\nsystem.tick();\n```\n\n\n## Documentation\n\ncoming soon!\n\n\n\n## Contributing\n\nIf you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/derhuerst/pour/issues).\n","versions":{"0.2.0":{"name":"pour","description":"pour is lightweight particle system.","version":"0.2.0","main":"dist/pour.js","keywords":["pour","particle","system","vector","field","emitter","particle","compute","javascript"],"author":{"name":"Jannis R","email":"mail@jannisr.de","url":"http://jannisr.de"},"homepage":"https://github.com/derhuerst/pour","repository":{"type":"git","url":"git://github.com/derhuerst/pour.git"},"bugs":{"url":"https://github.com/derhuerst/pour/issues"},"license":{"type":"MIT","url":"http://github.com/derhuerst/pour/raw/master/LICENSE"},"devDependencies":{"coffee-script":"^1.8.0","gulp":"^3.8.7","gulp-filelog":"^0.4.1","gulp-concat":"^2.3.5","gulp-buffer":"^0.0.2","gulp-header":"^1.0.5","gulp-size":"^1.1.0","gulp-rename":"^1.2.0","browserify":"^10.2.4","vinyl-source-stream":"^1.1.0","gulp-streamify":"^0.0.5","gulp-uglify":"^1.0.1","gulp-gzip":"^1.1.0","del":"^1.2.0","mocha":"^2.2.5","mocha-tldr-reporter":"^1.0.0"},"scripts":{"dist":"gulp","test":"mocha --compilers coffee:coffee-script/register --reporter mocha-tldr-reporter","prepublish":"npm run dist && npm test"},"contributors":[{"name":"Jannis R","email":"mail@jannisr.de"}],"gitHead":"a7500bca86c35204339319ff6c5b35cd0060e7f9","_id":"pour@0.2.0","_shasum":"1d399a1f2e213f010f22438056ce6ac9a2c513f6","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.4","_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"dist":{"shasum":"1d399a1f2e213f010f22438056ce6ac9a2c513f6","tarball":"https://registry.npmjs.org/pour/-/pour-0.2.0.tgz","integrity":"sha512-QqnNf+303D2Z4LllgjCMUMDcxdkStbNCbIRD/6OdZPZFieRIwI9QupqU50hBNdh8T50rfwHIK7p9JgbFSg/u6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYCEdB6CWundOR/fH/hdAKM36EpHhXs2dgwRlx0wjnZAiEAuQaQw56PvkI6j1R6UNwtZsdmOkGgQWUluNJs/zSSI1U="}]},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"deprecated":"This package is outdated and unmaintained.","directories":{}},"0.2.1":{"name":"pour","description":"pour is lightweight particle system.","version":"0.2.1","main":"dist/pour.js","keywords":["pour","particle","system","vector","field","emitter","particle","compute","javascript"],"author":{"name":"Jannis R","email":"mail@jannisr.de","url":"http://jannisr.de"},"homepage":"https://github.com/derhuerst/pour","repository":{"type":"git","url":"git://github.com/derhuerst/pour.git"},"bugs":{"url":"https://github.com/derhuerst/pour/issues"},"license":"MIT","devDependencies":{"coffee-script":"^1.9.3","gulp":"^3.9.0","gulp-filelog":"^0.4.1","gulp-concat":"^2.6.0","gulp-buffer":"^0.0.2","gulp-header":"^1.2.2","gulp-size":"^1.2.3","gulp-rename":"^1.2.2","browserify":"^11.0.1","vinyl-source-stream":"^1.1.0","gulp-streamify":"^0.0.5","gulp-uglify":"^1.2.0","gulp-gzip":"^1.2.0","del":"^1.2.0","mocha":"^2.2.5","mocha-tldr-reporter":"^1.0.0"},"scripts":{"dist":"gulp","test":"mocha --compilers coffee:coffee-script/register --reporter mocha-tldr-reporter","prepublish":"npm run dist && npm test"},"contributors":[{"name":"Jannis R","email":"mail@jannisr.de"}],"gitHead":"458872cdaf199ec4d50fe16db19c842c928b67a0","_id":"pour@0.2.1","_shasum":"ffda502737f00d32801fe534fd9b63e8569e83d9","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.7","_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"dist":{"shasum":"ffda502737f00d32801fe534fd9b63e8569e83d9","tarball":"https://registry.npmjs.org/pour/-/pour-0.2.1.tgz","integrity":"sha512-J/Le6GJ6hyNkV9vwaF6VyJ7HIxH1f3pYVG0YBosf2ARidfKlqGwJ0+e4z/5pT4QUesvUM9puAOXLIRM9Bs1GLg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgbroMcsC5X70xgtIJ+01ATzk0TmKJaW1nPEhFt2do8QIgAY6mfnA40uQkfGY8zPvs3gvAYCrmKarT12OvdT3zmxk="}]},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"deprecated":"This package is outdated and unmaintained.","directories":{}},"0.3.0":{"name":"pour","description":"pour is lightweight particle system.","version":"0.3.0","main":"dist/pour.js","keywords":["pour","particle","system","vector","field","emitter","particle","compute","javascript"],"author":{"name":"Jannis R","email":"mail@jannisr.de","url":"http://jannisr.de"},"homepage":"https://github.com/derhuerst/pour","repository":{"type":"git","url":"git://github.com/derhuerst/pour.git"},"bugs":{"url":"https://github.com/derhuerst/pour/issues"},"license":"ISC","devDependencies":{"coffee-script":"^1.10.0","gulp":"^3.9.0","gulp-filelog":"^0.4.1","gulp-concat":"^2.6.0","gulp-buffer":"^0.0.2","gulp-header":"^1.7.1","gulp-size":"^1.3.0","gulp-rename":"^1.2.2","browserify":"^11.2.0","vinyl-source-stream":"^1.1.0","gulp-streamify":"^0.0.5","gulp-uglify":"^1.5.1","gulp-gzip":"^1.2.0","del":"^1.2.1","mocha":"^2.3.4","mocha-tldr-reporter":"^1.0.0"},"scripts":{"dist":"gulp","test":"mocha --compilers coffee:coffee-script/register --reporter mocha-tldr-reporter","prepublish":"npm run dist && npm test"},"contributors":[{"name":"Jannis R","email":"mail@jannisr.de"}],"gitHead":"9c08896e907b411188c3458a74ae548bc4afab9b","_id":"pour@0.3.0","_shasum":"ee4d490cc23f1417fbad7bfad08999c36e0dd2b3","_from":".","_npmVersion":"3.5.4","_nodeVersion":"5.4.1","_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"dist":{"shasum":"ee4d490cc23f1417fbad7bfad08999c36e0dd2b3","tarball":"https://registry.npmjs.org/pour/-/pour-0.3.0.tgz","integrity":"sha512-oJfChnfEhk5BKV2vXcEdzoSUXvxYFXhAlurQmvOHzcR2eleJ/3LXwT1Uxl5NbA0qNHfXGgya309Zh3KGzWZT2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfesN6aDWOutOv11XooKP2P2RHtp/rUyFZYRHnk1xHXgIhAOCrO+VM6UWbvejA5UWCjQZGhMUtLNGp0E5MWVgFlLk5"}]},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"deprecated":"This package is outdated and unmaintained.","directories":{}}},"homepage":"https://github.com/derhuerst/pour","keywords":["pour","particle","system","vector","field","emitter","particle","compute","javascript"],"repository":{"type":"git","url":"git://github.com/derhuerst/pour.git"},"contributors":[{"name":"Jannis R","email":"mail@jannisr.de"}],"author":{"name":"Jannis R","email":"mail@jannisr.de","url":"http://jannisr.de"},"bugs":{"url":"https://github.com/derhuerst/pour/issues"},"license":"ISC","readmeFilename":"README.md"}