GithubHelp home page GithubHelp logo

gamua / sparrow-extension-particle-system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from primaryfeather/sparrow-extension-particle-system

4.0 4.0 4.0 326 KB

A particle system for the Sparrow framework, compatible with the "Particle Designer" from 71squared.com

Home Page: http://wiki.sparrow-framework.org/extensions/sxparticlesystem

Objective-C 80.16% C++ 19.84%

sparrow-extension-particle-system's Introduction

Sparrow Extension: Particle System

The Sparrow Extension class "SXParticleSystem" provides an easy way to display particle systems from within the Sparrow Framework. That way, adding special effects like explosions, smoke, snow, fire, etc. is very easy to do.

The particle system is controlled by a configuration file in the format that is created by Particle Designer. While you don't need that tool to create particle systems, it makes designing them much easier.

Installation

In the src-directory, you will find 2 classes - the SXParticleSystem and a helper class. Add those classes directly to your Sparrow-powered game.

Demo-Project

The demo-directory contains a sample project. If you have configured your system for Sparrow, the project should compile and run out of the box.

The project contains 4 sample configurations. Switch between configurations in Game.m by changing the init-method:

mParticleSystem = [[SXParticleSystem alloc] initWithContentsOfFile:@"sun.pex"];

The following configurations are available:

  • drugs.pex
  • fire.pex
  • sun.pex
  • waterfall.pex

Sample Code

This is all you have to do to create a particle system. The class SXParticleSystem is a subclass of SPDisplayObject and behaves as such. You can add it as a child to the stage or to any other container. As usual, you have to add it to a juggler (or call its advanceTime: method once per frame) to animate it.

// create particle system
SXParticleSystem *ps = [[SXParticleSystem alloc] initWithContentsOfFile:@"sun.pex"];    
ps.x = 160.0f;
ps.y = 240.0f;

// add it to the stage and the juggler
[self addChild:ps];
[self.juggler addObject:ps];
[ps release];

// start emitting particles
[ps start];

// stop emitting particles
[ps stop];

More information

Find more information about this extension on the Sparrow Wiki.

sparrow-extension-particle-system's People

Contributors

primaryfeather avatar richy486 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.