The game was developed in Macromedia Flash, what I did was turn the main character into a button that starts an animation when the mouse is placed over it, and the villain of the game is an animation that when he looks at the protagonist an area above the protagonist is activated, if the mouse was over that area the game ended.