Summary
In this chapter, we have covered rendering sprites to the screen, including sprite sheets, but we actually covered so much more than that. We covered how to use futures and async
code in a WebAssembly app, how to parse JSON, and perhaps most confusingly how to send Rust closures to JavaScript via the Closure
struct. We also reviewed some of the quirks of using Rust in the WebAssembly environment from Chapter 1, Hello WebAssembly. This chapter was fun, but we made some messy code.
In the next chapter, we'll deal with that by setting up a simple architecture for our game and writing a proper game loop. Lest you think Chapter 3, Creating a Game Loop, is all refactoring, we'll also move our friend Red Hat Boy around the screen. It'll start to look like a real game!