Summary

In this chapter, we learned how to create a basic particle emitter configuration tool. We covered how to force Emscripten to create a virtual file system when there are no files loaded into it at application startup. We learned how we could load an image from our user's computer into the browser's virtual file system, and added functionality to allow us to upload a .png image file. We covered some basics of SVG, discussed the differences between vector and raster graphics, and learned how we would use SVG to draw pie charts for our configuration tool. We covered some basic trigonometry that was useful in this chapter, and will only become more useful in later chapters. We created a new HTML shell file that interacts with our WebAssembly, to help us configure a new particle system for our game. We created a Point, Particle, and Emitter class in a WebAssembly module that we are using for the emitter, which we will eventually use inside of our game. Finally, we learned about C++ name mangling, dead code elimination, and the circumstances where we must avoid them when writing Emscripten code.

In the next chapter, we will improve our particle emitter configuration tool. By the end of the chapter, we will use it to configure effects in our game such as explosions, solar flares, and spaceship exhaust plumes. The tool can be used to play around with different effects, and get a feeling for how they look before we add that effect into our game. Finally, we will take the values we used in our configuration tool and use them as a starting point for configuring the particle effects in our game.