Skip to content

Latest commit

 

History

History
53 lines (46 loc) · 1.39 KB

README.md

File metadata and controls

53 lines (46 loc) · 1.39 KB

spp.js logo

Welcome Spp.js

Spp.js is a sample physics particle system engine for javascript.

Feature

  • Code less, simple structure.
  • Based on classical Newtonian mechanics.
  • Make your own custom forces or particles
  • Easy to build interactive projects.
  • Open source!

Getting Started

var ps=new SPP.ParticleSystem();
var particle=ps.createParticle(SPP.Particle);
particle.life=3;
particle.position.x=50;
particle.position.y=60;
particle.addForce("someForceName",someForce);
particle.onUpdate=someUpdateHander;
particle.addEventListener("dead",deadHandler);
animate();
ps.start();

function someUpdateHander()
{
        ...
};
function deadHandler(event)
{
        ...
};

function animate()
{
       requestAnimationFrame(animate);
       ps.render();
       ...
} 

Examples

Support or Contact

Weibo: http://weibo.com/flashawk? or contact [email protected] and we’ll help you sort it out.