The C code

Since we're allowed to import C and C++ files directly, the C file is located within the /src folder. This file, main.c, contains logic to manage collision detection and move the spaceship around the <canvas>. The code is based on the without-glue.c file we created in Chapter 5Creating and Loading a WebAssembly Module. We're not going to review the entire file, only the sections that have changed and merit explanation. Let's begin with the definitions and declarations section, which includes a new struct: Bounds.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset