In this final chapter, we are going to discuss two topics that will be helpful as you go on to create games using Emscripten and build in WebAssembly. We are going to discuss the topics of debugging and optimization. We will debug before optimizing, because building your code to output more debuging information prevents optimization. We will start by using some basic debugging techniques, such as printing a stack trace and defining debug macros that we can remove by changing a compile flag. We will then move on to some more advanced debugging techniques, such as compiling with Emscripten flags, which allow us to trace through our code in Firefox and Chrome. We will also discuss some of the differences between debugging using the Firefox and Chrome developer tools.
Debugging and Optimization
You will need to include several images in your build to make this project work. Make sure...