This kind of works, but it has problems:
1-The health bar refuses to stay in the correct spot when damage is taken. That is, event 1 is supposed to "save" where its farthest left point is, change its width to match the player's HP, and then put its farthest left point in the same spot after the width is changed, but it seems to sort of jump to the right a bit anyway.
2-The player is supposed to get knocked back a bit by damage. This works fine coming from the left, but coming from the right it's completely broken. The player gets knocked left no matter where he is.
3-When the player's HP hits zero, the sprite is switched to the death animation, but then the player is fine until he hits the enemy once more. THEN the death animation plays and the player is destroyed. (The destroy is a placeholder for possibly an attempt to load the last save or make a game over menu or something, but that'll come much later).
Is anyone willing to help me out?