Coder Social home page Coder Social logo

bparticles's Introduction

BParticles

Small Customizable Particle System For Monogame

BParticles is a simple and expandable framework for using particles in Monogame.

THIS PROJECT IS STILL VERY EARLY AND SHOULD NOT BE USED IN ANY COMMERCIAL PROJECTS

Usage

Simply copy the BParticles folder into your own monogame project. You can also clone the "HelloWorldProject" branch and run it yourself in visual studio.

Once set up in your own project, creating a new particle system in BParticles can be done in as little as 4 lines of code.

  1. Instantiate the new system (particleTexture can be any Texture2D)
_particleSystem = new ParticleSystem(particleTexture);
  1. Update the system in the Update() method in your game
_particleSystem.Update(gameTime);
  1. Render the system in the Draw() function
_spriteBatch.Begin();
_particleSystem.Draw(_spriteBatch);
_spriteBatch.End();
  1. Play it from anywhere in your code!
_particleSystem.Play();

**Here is the code to set up an example particle system

_particleSystem = new ParticleSystem(particleTexture);
_particleSystem.AddSpawnModifier(RandomColor);
_particleSystem.AddSpawnModifier(x => x.Velocity = GetRandomVector(-50f,50));
_particleSystem.AddSpawnModifier(x => x.Lifespan = 1f);
_particleSystem.SystemPosition = _ScreenCenter;
_particleSystem.Play();

The package should be fully docstringed but full documentation is planned, feel free to use the issue board for any feature requests or if you find any issues

bparticles's People

Contributors

bish0pdev avatar

Stargazers

 avatar

Watchers

 avatar

bparticles's Issues

More Example Content

It'd always be cool to have more example content to play around with on the ExampleScene

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.