Having an issue passing sprite arguement to the .on

The inner function can still access the outer function’s variables.

With on() you can’t pass values to a callback. The event emitter always chooses which arguments the callback receives.

1 Like