You are browsing as a guest. Sign up (or log in) to start making projects!

1h 24m 21s logged

Hiya there! Another devlog on this project!!

This time I added an actual particle system to the engine that can be used to spawn a bunch of little particles. It’s still missing a bit of customization such as turning off gravity for particles or the ability to change particle’s initial velocity, but so far it isn’t causing any lag and seems to work well! I had to figure out THREE.js’ InstancedMesh system to get this working without making the game run horribly, but I got it and it works now!

The docs are also updated to reflect this new feature. And the ParticleSystem is used like any other component by just adding it to an object like the following:

app.addObject(
    app.createObject(
        new Phoenix.Transform(new Phoenix.Vector2(0, 0), 0, new Phoenix.Vector2(32, 32)),
        new Phoenix.ParticleSystem("assets/brick.png", 10, new Phoenix.Vector2(24, 24))
    )
)

The entire system for particles is self contained and doesn’t rely on any other components like the Renderer and Sprite because I felt it would be better to separate it due to the fact that the particles using an InstancedMesh, and the user might want to have particles have a different texture than their emitter.

As shown in the images, the ParticleSystem can support a lot of particles and from some testing it is able to handle 10, 1000 and 10000 particles with no lag, but 100000 particles is stretching it a bit. I mean who would put over 10000 particles on screen at a time though, right?

0
2

Comments 0

No comments yet. Be the first!