GithubHelp home page GithubHelp logo

l4u / ccparticlesystemadvanced Goto Github PK

View Code? Open in Web Editor NEW

This project forked from varedis/ccparticlesystemadvanced

0.0 1.0 0.0 112 KB

The code required to run CCParticleSystemAdvanced for Cocos2d

ccparticlesystemadvanced's Introduction

CCParticleSystemAdvanced

The code required to run CCParticleSystemAdvanced for Cocos2d.

CCParticleSystemAdvanced plists are generated using Particle Producer which is available on the Mac App Store

(Link to follow once available)

CCParticleSystemAdvanced is an ongoing effort to build a better particle system for use in Cocos2d games and utilities.

The current benefits over the standard CCParticleSystem are:

. Alter the size over the lifetime of the particle. This lets you be in full control over how a particle system behaves over it lifetime.

. Alter the colour over the lifetime of the particle, this gives you fill control over what colour the particle should be at certain stages of its life for advanced effects.

. Make multi layered particle systems and export them all in one .plist.

Experimental: Particle loading from spritesheets.

More features are on the way in future versions including: . Particle animation. . A greater range of movement and animation controls.

And much more

Use

Normal Use

Setup is designed to be as simple as possible, simply drop the generated .plist in your project with the required images and then call:

LayeredParticleSystem *pst = [[LayeredParticleSystem alloc] initWithPlist:@"myAdvancedParticle.plist"];
    pst.position = ccp(0,0);
    [self addChild:pst];

This setup will use the images that are defined in the plist to create your particle system

Experimental Use

You can also use a series of images to populate the particle system, this functionality is still a work in progress at the minute and will be worked on greatly in upcoming revisions. Using this system you could have for example 10 different fire particles which get spawned and randomly assigned to each particle in the system, this gives you a greater effect and variation than just using one duplicate image throughout the entire system.

There are a few rules to follow when using this system: . Images must all contain the same name and should contain an incremental suffix depending on the number of images, for example if your image is called skulls_01.png then the other images must be called skulls_02.png, skulls_03.png and skulls_04.png . At the minute the images will be applied to all layers of the particle system, so this should only really be used on one layer systems

To use this functionality call the following code:

LayeredParticleSystem *pst = [[LayeredParticleSystem alloc] initWithPlist:@"myAdvancedParticle.plist" WithSpriteSheet:@"ParticleEffect.plist" andString:@"skulls" count:4];
    pst.position = ccp(0,0);
    [self addChild:pst];

The spritesheet is the name of the plist where the images are stored. The string is the prefix of the image name, without the number. The count is how many images there are in total (your images suffix should range from 01 to this number)

ccparticlesystemadvanced's People

Contributors

cocojoe avatar drecom-jenkins avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.