I updated the example a bit to include animations.
It now records position, angle, animation, animation frame and when the player shoots. I also changed it to just reset the layout instead of moving the player back to it's starting position. The ghost and array objects are now global so they aren't destroyed when resetting the layout.
This has ended up being a very enjoyable example to work on.