Skip to content

flashhawk/spp.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2b4cc09 · Mar 11, 2014
Nov 20, 2013
Nov 19, 2013
Nov 20, 2013
Mar 11, 2014
Mar 11, 2014
Nov 16, 2013
May 4, 2013
Apr 3, 2013

Repository files navigation

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 with popular HTML5 2D rendering engine:pixi.js,EaselJS
  • Open source!

Getting Started

<script src="js/spp.min.js"></script>
<script>
        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);
        particle.on("dead",deadHandler);
        animate();
        ps.start();
        
        function someUpdateHander()
        {
                ...
        };
        function deadHandler(event)
        {
                ...
        };
        
        function animate()
        {
               requestAnimationFrame(animate);
               ps.render();
               ...
        } 
<script>

Examples

Game

Case

Docs

Tutorials

How to build

Spp.js is build with ant and closure-compiler

$>cd spp's root directory

Then build:

$> ant

Support or Contact

Weibo: http://weibo.com/flashawk? or contact flashhawkmx@gmail.com and we’ll help you sort it out.

License

This content is released under the (http://opensource.org/licenses/MIT) MIT License.