Here is a Demo of what I think you need:
The Demo uses the Sprite Utils extension:
jwunderl/arcade-sprite-util