I've been using `game.camera.onShakeComplete` for running functions after animations are complete, but each time it adds a new instance to be run.
I've been using
game.camera.shake(0.02, 250, true, Phaser.Camera.SHAKE_HORIZONTAL, true);
game.camera.onShakeComplete.add(function(){runFunction()}, this)
to run my code, but I just realised that this adds another function to be run each time, and I can't really have just one for the entire game because they need to do different things.
My questions really boil down to:
Can I have a callback per game.camera.shake or can I only have one global one?
Can I clear game.camera.onShakeComeplete so I can add a new one each time? It's probably not that efficient but it'd work.
Is there a way to pass arguments from game.camera.shake to the onShakeComplete so I can have a switch statament in there or something?
Thanks.