I am very new to html5 game making.
Recently I am making a game which includes some animations using png sprite.
https://i.stack.imgur.com/y6512.png
I have a background and I try to use this sprite to mask it, I was trying to use getImageData() & putImageData() to show only the circle part of each frame of the sprite, everything's cool until I try to make another "circle" near to the first one.
The problem is I cannot make both "circle" animate at the same time if the sprite sheets overlap with each other... And this is the very start of my project, the final aim is like making 100 "circles" on random positions.
So is there a method to use this sprite sheet to make animating circles, showing the background in the circle part only even if there are several "circles" which overlapping each other?
Sorry that my english is bad and I try my best to describe the question...Any suggestions would be great and I can elaborate more on the question if needed! Thanks!!
PS: I have tried to do my homework before posting, the most neareast reference I can find is http://simonsarris.com/blog/140-canvas-moving-selectable-shapes, but I do not know how to apply the concept of the "ghost canvas" into my case..