Additional variable coercions

After the start_color and end_color coercions, the remaining coercions we must perform should feel familiar. We coerce the values in burst_time, burst_particles, emit_time, and animation_frames into Number variables. We coerce the checked values from loop and align_rotation into Boolean variables.

Here is the remainder of the coercion code:

var burst_time = Number(document.getElementById
("burst_time").value);
var burst_particles = Number(document.getElementById
("burst_particles").value);
var loop = Boolean(document.getElementById
("loop").checked);
var align_rotation = Boolean(document.getElementById
("align_rotation").checked);
var emit_time = Number(document.getElementById
("emit_time").value);
var animation_frames = Number(document.getElementById
("animation_frames").value);

Finally, we need to add the variable types and the new variables into our Module.ccall call to update_emitter in our WebAssembly module:

Module.ccall('update_emitter', 'undefined', ["number", "number",                                       "number", "number", "number", "bool",
"number", "number", "number", "number", "number","number",
/* new parameters */
"number", "number",
"number", "number",
"number", "number",
"number", "number",
"bool", "bool", "number"],
[max_particles, min_angle,
max_angle,
particle_lifetime,
acceleration, alpha_fade,
min_starting_velocity,
max_starting_velocity,
emission_rate, x_pos,
y_pos, radius,
/* new parameters */
min_start_scale,
max_start_scale,
min_end_scale,
max_end_scale,
start_color, end_color,
burst_time,
burst_particles,
loop, align_rotation,
emit_time,
animation_frames
]);