This was created using the tutorial at http://wiki.scratch.mit.edu/wiki/Turn-Based_RPG. However, there is a glitch. Even when the enemy's HP is not zero, if its HP goes down from an attack even once, you win.