Search the Community

Showing results for tags 'particles'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 78 results

  1. Particles dispose

    Hi! Have some problem, I create many particles systems in my game and very often delete them after first playing, but if I using the same texture in particle systems, then after first disposing of particle system the texture disposing too. And I should to cloning each one new texture, but it is bad for performance. How I can to create a particles systems with same texture but after disposing particles system do not dispose texture? Thanks!
  2. Solid Particle Parenting

    Hi Folks, Here's a SPS new feature : the particle parenting. Simple to understand : once a particle has a parent, all its rotation, position and pivot are then expressed in the parent particle local space. Simple to use : sps.initParticles = function() { for (var i = 1; i < sps.nbParticles; i++) { // declare each previous particle as the parent of the current one sps.particles[i].parentId = i - 1; } }; sps.updateParticle = function(p) { // each particle will rotate for +0.001 in the already rotated parent space particle.rotation.z += 0.001; } examples : the green box is parented to the translating red one, it also rotates around a local pivot 600 boxes, parented per groups (stems) of 10, each rotating around its pivot :
  3. I don't undestand why the updateFunction of my particle system is still called after I stop the system. See console in this playground : I stop the particle system after a 1 second timeout and the console show that the updateFunction is still called. Thanks, Pichou
  4. Greetings! I'm currently playing around with PIXI.particles.ParticleContainer and am having a blast. What an awesome container! I'm writing because I'm having a peculiar issue regarding mouse events and the particles inside the ParticleContainer. Specifically, I create the ParticleContainer, add sprites to it via PIXI.Sprite.fromImage and then bind mouse down events to each sprite and specify a hit area for the sprite as well. That works! Specifically, it works if I add the sprites to the ParticleContainer and don't specify a position, and all the sprites show up in the top left corner of the ParticleContainer. However if I move the sprites around in the container by adjusting the sprite's x,y values, the hit area remains in the in the top left corner and I can still trigger the mouse event there, but that's clearly not the intent. I had guessed that the hit area would follow the sprites as they move around the container. Is this true? I'm posting below a section of my code to help explain. Thank you to any PIXI wizards who might have insight here. // Create the graph container this.graphContainer = new PIXI.particles.ParticleContainer( numNodes, { scale: true, position: true, rotation: false, uvs: false, alpha: false } ); this.graphContainer.hitArea = new PIXI.Rectangle(0, 0, 1000, 1000); this.graphContainer.interactive = true; this.graphContainer.interactiveChildren = true; // Create the graph nodes for (var i=0; i<numNodes; i++) { var x = graphData['nodes'][i]['x']; var y = graphData['nodes'][i]['y']; var node = new Node(, null, x, y); this.nodes.push(node); this.graphContainer.addChild(node.getSprite()); } class Node { constructor(top, type, x, y) { = top; this.initPosition = { 'x': x, 'y': y }; this.createSprite(); } createSprite() { this.sprite = new PIXI.Sprite.fromImage('images/bcat.png'); this.sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); this.sprite.interactive = true; this.sprite.buttonMode = true; this.sprite.on('mousedown', (event) => { console.log('sprite event'); }); this.sprite.anchor.set(0.5); this.sprite.x = this.initPosition['x']; this.sprite.y = this.initPosition['y']; } getSprite() { return this.sprite; } }
  5. Hello, I need my particles affected by an airplane propeller flying through them. How might I accomplish this? Thanks, DB
  6. Hi everyone, so i have a question about how i can make my particles emitter to move from point to point and is it possible to do this. I have an exact example of what i need. Can someone give me a simple code example ? Thanks.
  7. Interactive Snowcone

    For a Christmas Newsletter we created an interactive snowcone. The model represents our hometowns city tower. On desktop the snow is simply triggered by mouse drag, on mobile you can actually "shake" to let it snow. This was actually my first Babylon.js project and I'm quite happy with the result.
  8. Hi guys, I am using AnimateCC to output canvas animations and would love to know how I would go about using the json file that is made available for download when using: . My objective is to simply create a particle emitter and then use it within my animation, but I have trouble connecting the dots. Ideally the Pixi json would need to be included in the published js file. Any tips on where that code would need to go exactly? I added the pixi library as a global script to the Animate file, but was wondering if someone could walk me through the process of combining the power of AnimateCC with PIxi.js Any tips are welcome! Thanks!
  9. Need advice for some project

    Hi guys. I want to create a effect in PIXI, that looks like first frames in this video -> (stars shooting/flying by). What would more experienced PIXI'oniers advice to achieve such effect? Performance is critical, I want it also to work on mobiles. For now I'm thinking: 1) Particle container, that's for sure? Maybe with some 1-3 star sprites? 2) Projection plane for start movement? Or just calculate it with some custom simple logic?
  10. Hi, when manualEmitCount is set on ParticleSystem it rendered only one wave of particles, is that desired behaviour? Looking in code I found that if manualEmitCount > -1 than its set to 0 so next time 0 particles are emitted. PG
  11. Hi, I created particle system to add some particles in the game but couldn't find a way to blend particles in (now they just appear immediately and than start to blend and move). Is there any why to to it that I have missed ? As I checked code, looks like there is no direct way to do it as all methods are privet and colour is set on birth.
  12. Question about using emitters in Phaser and what is the best practice for perfomance and memory use. Let's say a typical game where the player collects coins and occasionally there is a bomb. Whenever the player collects a coin there appear a few (like 3 or 4) particles, when a bomb explodes there are different type particles and when the player dies a few star particles appear. A typical game probably has more, but just as an example here it's three different particle effects. What would be the best way to handle this in Phaser? 1. create three emitters at start of game, reuse same three throughout game 2. create one emitters for coin particles and reuse throughout game, and create new bomb/stars emitters as needed 3. create new emitters for each instance that particles are needed About that 3rd option, I figure that will take a toll on memory usage because emitters don't auto-destroy once they are finished. So would you need to destroy them manually, and if so how? Or is creating many emitters just not a good idea at all? I'd love to hear any ideas or best practices on this.
  13. In the online documentation, I can read that the emitter's update() function require a delta parameter in seconds, (in bold): But, as far as my experiments go, converting my frame time in seconds seems not to work. It does in milliseconds. Am I wrong somewhere?
  14. I'm noticing from the profiler that when I run the particle emitter in my game, the heap builds up over the course of a couple seconds and then drops back down after the garbage collection. To be sure the test is accurate, I've turned off everything else in my game so it is *only* the particle emitter that is running. My understanding is that once the initial pool of particles are created (in my case, 200), no more objects should be dynamically allocated, so why is this happening? My emitter uses a custom particle class that calls the kill() method on the particle when the particle gets more than a certain distance away from the source. My impression is that by calling kill rather than destroy, Phaser should be able to use the same particles over and over again. Why is Phaser, apparently, not reusing the particles? I'm using Phaser 2.6.2.
  15. NeutrinoParticles became much better for the last year. Because of workflow improvements and after Emitter Guide introduced, you can create a great effect in a few minutes from the scratch. The editor has full set of video tutorials for beginners and a lot of samples. And it is totally free for now. Canvas, WebGL and PIXI renderers are available (even C#/Unity one, but that is another story). So, what do you think? Is it good enough to be the best one?
  16. Hi all, I want to modify a bit the emitter, for example this: but for example if we want to set positions of particles at the creating of stage, no want to wait while the snow will fill the screen: back_emitter.forEach(function(particle) { particle.x = game.rnd.integerInRange(0, game.WIDTH); particle.y = game.rnd.integerInRange(0, game.HEIGHT); particle.body.velocity.y = game.rnd.integerInRange(140, 240); }); But looks like that velocity don't work. What's wrong with code?
  17. SPS with different models

    Hi team, @jerome @Wingnut I have an question relative to solid particle system (SPS). I need to create a SPS composed with different buildings (.obj files). This is my code but i only can add one of them. How can I solve it? var models = function(edificios_texto) { var t = 0; var loader = new BABYLON.AssetsManager(scene); edificios_texto.forEach(function() { if(edificios_texto[t].length!=2){ return; } var edificio = loader.addMeshTask(t, "","<?=$url?>assets/modelos/",edificios_texto[t]+".obj"); var nM; //mesh of building edificio.onSuccess = function (task) { task.loadedMeshes.forEach(function(b) { b.scaling = new BABYLON.Vector3(2.65, 2.65, 2.65); b.rotation.y = Math.PI; b.computeWorldMatrix(true); var vertex_data = BABYLON.VertexData.ExtractFromMesh(b); for (var i = 0; i < vertex_data.normals.length; i+=3) { vertex_data.positions[i] *= -1; } vertex_data.applyToMesh(b); }); nM = BABYLON.Mesh.MergeMeshes(task.loadedMeshes); for (var i = 0; i < edificios.length; i++) { if(edificios[i].descripcion == edificios_texto[]){ var myPositionFunction = function(particle, s) { var utmPlaceX = edificios[i].x; var utmPlaceZ = edificios[i].z; var utmPlaceXFromCentre = utmPlaceX - mapCentreX; var utmPlaceZFromCentre = utmPlaceZ - mapCentreZ; var x = utmPlaceXFromCentre/scaleX; var z = utmPlaceZFromCentre/scaleZ; particle.position.x = x; particle.position.z = z; particle.position.y = alturas[ edificios_texto[]]; particle.color = new BABYLON.Color4(0, 0, 1,0.5); }; spsEdificios.addShape(nM, 1, {positionFunction: myPositionFunction}); nM.dispose(); break; } } var buildings = spsEdificios.buildMesh(); spsEdificios.mesh.hasVertexAlpha = true; } t++; }); loader.load(); }; Thanks!
  18. Emitter Explosion not exploding

    Hey Community, I just updated from 2.5.0 to 2.7.8 and now my emitters don't explode anymore. They produce there particles and them which live for there desired lifespan but don't move anymore. var em = game.add.emitter(0, 0, 10); em.makeParticles('SBCollectibles', ['StarOrangeParticle.png', 'StarPinkParticle.png', 'StarYellowParticle.png']); em.setXSpeed(-300, 300); em.setYSpeed(-300, 300); em.gravity = 500; em.start(true, 500, null, 10); I rolled back to 2.5.0 and work as expected
  19. Electricity?

    So I'm experimenting with electricity (again). : ) Didn't see anything in searches. Ever see anything like that? Thinking low-poly, or cartoonish aok: - particle system with little glowing star-diamonds...? - animated line bezier (or zig zag line) with emissive light? - import from blender animation(possible) - and or... spherical harmonics, lasers, and small godray?!? What would you try first? - YouTube has some videos of Blender, electric arc's or - Hook Wave: looks like a sine wave! Only the spark is needed - not the anodes or y movement. Idea: glowing low-poly sine-wave would be cool.... looking at this: Thanks,
  20. Fast forward particles

    Hi eveyone, Just realised how powerful Phaser's particle system really is. I've set up an emitter to create a continuous 'snow' effect for my game's main menu background. I was wondering though if it was possible to make the particles 'fast forward' a couple of seconds when I load the game. What I mean is, how can I make it so that when the user switches to the main menu state, the particles are already all over the place as if the emitter had been running for a couple of seconds. Instead of the state starting off like this: How can I make it start like this, with the particles already everywhere: Thanks for your help!
  21. Hello, I have just purchased the Particle Storm plugin. I like it a lot and it makes it easy to make complicated things, but I cannot make a simple thing easily. What I would like to do is stop/remove/hide the particle effect/emitter when the user is starting a new round and then show it again when needed. That's where I am stuck - I simply can't manage to do something as simple as hiding/stopping/removing the particles. I searched through the docs but I can't seem to find an opposite of the .emit() method, i.e. a way to stop it? Then as a last resort I tried to destroy the emitter object and then recreate it when needed, but even that doesn't work. I though my code was causing the problem somewhere but then I took one of the examples (pixel_renderer_01.html) and just added a call to destroy after 2sec at the end of the create method and it generates the same error in the console as my code: Uncaught TypeError: Cannot read property 'add' of null at Phaser.ParticleStorm.Particle.create (particle-storm.min.js:2) at Phaser.ParticleStorm.Particle.reset (particle-storm.min.js:2) at Phaser.ParticleStorm.Emitter.emitParticle (particle-storm.min.js:2) at Phaser.ParticleStorm.Zones.Line.emit (particle-storm.min.js:2) at Phaser.ParticleStorm.Emitter.emit (particle-storm.min.js:2) at c.Timer.update (phaser.min.js:19) at c.Time.updateTimers (phaser.min.js:19) at c.Time.update (phaser.min.js:19) at c.Game.update (phaser.min.js:12) at c.RequestAnimationFrame.updateRAF (phaser.min.js:18) at window.requestAnimationFrame.forceSetTimeOut._onLoop (phaser.min.js:18) Attached you can find the example file with the code added by me, I believe I really didn't manage to do anything wrong in those 5 lines (my code is lines 64 to 73)? Or am I taking a completely wrong approach, what should I do to stop the emitter when needed and then restart it again when needed? Kind regards, Darko pixel renderer01.html
  22. Hi guys ! I'm struggeling on something. I want to make a static particle system that is child of a mesh for all particles to be relatively positionned to that element. I have tried to getWorlMatrix() of mesh, to parent the mesh to particle system and mess with all matrix functions with no results... Example: -I have spaces cubes (8) that I move according to player position to give the effect of an infinite map (see previous post ) -my particles are "dust" in those cubes that are created once and are static But when I move my cube to another position, particles stays at the same place.... Have you got a clue ? Edit: another noob more general question: How to select all particles as an object like (for using clone, createInstance, position...)? Thank you guys
  23. Hello! New Babylon user here--also new to 3D graphics and visual programming in general. I'm making a 3D visualization in Babylon and am a little stuck. Searched this forum for relevant topics but wasn't really even sure what to look for, tbh. WHAT I HAVE SO FAR A very simple visualization that uses the Solid Particle System. I add 1,000 shapes to it (flat triangles) and arrange them into 10 flat 10x10 (x, z) grids, all at the same initial y coordinate, and all initially invisible. Every few seconds, I take an invisible 10x10 grid make all 100 of its particles visible. My `SPS.updateParticle` just tests if `isVisible` is true, and if so, rotates it a little bit, and moves it down a little bit (decreases `position.y`). It also tests if the particle's y position is below a certain threshold--if it is, it calls `recycleParticle` on it, which simply makes it invisible again and sets its y position back to original starting height. It thus looks like an infinite series of 10x10 grids of flat triangles, appearing in thin air at a particular location, falling downwards, and then disappearing. At any given point there are maybe 6 or 7 grids visible simultaneously, all falling within the imaginary 3D rectangular prism defined by their (x, z) borders and their downward y motion. WHAT I HAVEN'T BEEN ABLE TO FIGURE OUT: I want to project a video onto the visible particles, like a moving, shifting projector screen. The projector could be at a fixed position, or it could be behind the camera, whatever's easiest at this point. My instinct was to make each particle translucent, and just place the video on the opposite side of the particles from the camera such that it plays "through" the translucent particles. But I can't figure out a way to have the video ONLY be visible through the particles, and not just look like a TV screen with a bunch of triangles in front of it. Let me know if any of that is unclear. Trying to get a playground up at some point but it's simple enough I thought I'd just ask. Thanks in advance for all your help, and for building such an awesome tool! I've had a lot of fun learning how to use it!
  24. Fading out emitters particles

    Hello! I'm trying to do simple explosion with emitter. I want particles to slowly fade out so I do: emitter.setAlpha(0.2, 1, 10, Phaser.Easing.Linear.None, false); emitter.autoAlpha = true; But when i run game and emitter start doing it's job it throws at the console: Uncaught TypeError: Cannot read property 'v' of undefined at Phaser.Particle.update (phaser_phaser_1.js:99052) at Phaser.Particles.Arcade.Emitter.update (phaser_phaser_1.js:99548) at Phaser.World.Phaser.Group.update (phaser_phaser_1.js:33716) at Phaser.Stage.update (phaser_phaser_1.js:31820) at Phaser.Game.updateLogic (phaser_phaser_1.js:36338) at Phaser.Game.update (phaser_phaser_1.js:36280) at Phaser.RequestAnimationFrame.updateRAF (phaser_phaser_1.js:61979) at _onLoop (phaser_phaser_1.js:61962) What am I doing wrong with this task? Edit: Solved - it seems like I set too low alpha rate parameter (third param. in setAlpha). I misunderstood how it works. Now I get it. If I set rate as 1500 ms particles will fade out in this time. It works now.