Search the Community

Showing results for tags 'particles'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Found 70 results

  1. Need advice for some project

    Hi guys. I want to create a effect in PIXI, that looks like first frames in this video -> http://hubblesite.org/video/513/news_release/2006-01 (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?
  2. 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
  3. 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.
  4. 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.
  5. In the online documentation, I can read that the emitter's update() function require a delta parameter in seconds, (in bold): http://pixijs.github.io/pixi-particles/docs/PIXI.particles.Emitter.html#update 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?
  6. 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.
  7. 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). https://neutrinoparticles.com/ So, what do you think? Is it good enough to be the best one?
  8. Hi all, I want to modify a bit the emitter, for example this: http://phaser.io/examples/v2/particles/snow 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?
  9. 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[edificio.name]){ 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[edificio.name]]; 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!
  10. 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
  11. 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: https://doc.babylonjs.com/tutorials/how_to_use_curve3 Thanks,
  12. 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!
  13. 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
  14. 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
  15. 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!
  16. 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.
  17. Using of PIXI's shaders outside framework

    Hi. I'm working on PIXI plugin for Neutrino Particles (neutrinoparticles.com). Because JS is not my favorite language (it's C++ one), it is not straightforward for me to understand and use some JS constructions. In particular, I didn't get how modules of PIXI are connected into one file and how they include features of each other. So, I see how shaders are created inside the framework, but I can't create them outside pixi.js framework. Is it possible to use such features, like shaders and VAO outside? P.S. Currently, the plugin works pretty good. I still need to resolve some troubles with saving/restoring gl state, but the rest is fine (not perfect). I made rendering with my own shaders and vertex buffers, but I thinks it would be much better to use PIXI's features for that. Canvas works fine - it was much easier to get up. You can find sources of the plugin and samples for PIXI here: https://github.com/ymiroshnyk/neutrinoparticles.js/tree/PIXI The sources are work in progress and are in separate "PIXI" branch until finished. Neutrino Particles would be a great addition to PIXI features. You can check live JS gallery and a couple of latest video tutorials. Thanks.
  18. melonjs-particle system

    Hi, I am try to use particles in my code. so i have registered it like this "me.pool.register("droplet", game.dropletParticle, true);" and in my entity.js i have written "game.dropletParticle = me.SpriteObject.extend({ init: function(x, y) { // class constructor this.parent(x, y, me.loader.getImage("droplet")); }, game.startEmitter = function(x, y, count) { // add count particles in the game, all at once! for (var i = 0; i < count; i++) // add the particle in the game, using the mouse coordinates and game layer 5 // use the objects pool for better performance! me.game.world.addChild(me.pool.pull("droplet", x, y), 5); };" i have mentioned the image in resources.js as well but I am getting the following error ---me.Error: Cannot register object 'droplet', invalid class--- all my other images i have used tmx file. Can someone help me here!!!
  19. Emitter particles following parent

    Hey guys, I have 2 questions. 1. Why can't a particle emitter follow a sprite using trackSprite? emitter.trackSprite(player, 48, 24); 2. Currently my emitter follows the parent (player) by setting the emitters position on every step as mentioned here http://www.html5gamedevs.com/topic/5549-anchor-emitter-to-sprite/ The problem is that all the particles follows my sprite after it is emitted. I have attached the exact code I used below. I don't want the emitted to share their local coordinates with the emitter after it has been fired. //Called every time my character shoots a weapon. emitter.position.x = player.position.x; emitter.position.y = player.position.y; emitter.start(true, 1000, 500, 1, true);
  20. Hello gamedevs! I just jumped into Phaser, and feel realy well prepared after the Zenva course, Examples and the help of the Forum. But I just run into a problem where I can't find any solution. I just setup a Emitter who is creating world/another colliding bubbles within a mask. What I now want is to collide them also with my Input (mouse/touch). (Everyone knows the effect of run the mouse into a particle bubble bath :D) I tried following: -Find any Emitter function in the docu -Move a colliding box to the position where I clicked (he doesnt moves bubbles who within the box, just colliding with the ones who newly fall into it) -Add a Drag function to Particles (emitter.input.enableDrag(true); doesnt work; cant find any equal function in docu) Maybe I am just looking for the wrong keywords, but cant understand this common effect of colliding emitter particles with Mouse Input is that hard to find Would be awesome if you can point me!! Thanks in advance, have a nice day //Update #1 It seems like their is a problem with Dragging Sprites and their correct collision detection. For another smilar problem I want a red ball to drag out of this bubble bath. Same problem, but now I let them drag out via follow mouse, collision works now correct.
  21. I see something different if I go directly here: http://babylonjs-playground.azurewebsites.net/?28 to if I, say, go here: http://babylonjs-playground.azurewebsites.net/?12 then choose PBR from the drop-down box. When I do the latter the four meshes are semi-transparent. I've managed to reproduce this on both Firefox and iPad. I'm guessing that one or the other of the playground entries is setting some global state that it shouldn't? By the way, the "wrong" way is actually quite an interesting effect: the balls look a bit like very delicate glass, or soap bubbles. It might be worth adding a comment, or bool var, to say how the effect can be reproduced.
  22. This topic is only for further research in the forum purpose. Just a link to this post :
  23. Hi All, I am trying to set up a scene with a particle system but was hoping to render it with a transparent background. When I try in Chrome the particle system is clipped to the mesh in a very rough fashion and has some weird discolouration. I have a playground setup here: http://www.babylonjs-playground.com/#1SZQGH#0 Is there anything I can do to get this to work in Chrome? It works perfectly in Firefox or IE. Any assistance is greatly appreciated. Thanks
  24. Is there some way to get particles to be colored by fog? here is a playground example of them not being effected: http://www.babylonjs-playground.com/#AZDGV#5