I\'m trying to create a platform game in Canvas. I have main character and some enemies. When player touch enemy, he will lose some HP and he will be untouchable for about 3
You can also use save and restore.
context.save(); context.globalAlpha = 0.5; .... context.restore(); //this will restore canvas state