Created
August 10, 2011 06:54
-
-
Save taybenlor/1136271 to your computer and use it in GitHub Desktop.
Too Many Pixies Enemy Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@enemy.listen "health", (newval) => | |
@element.addClass('hit') | |
setTimeout(=> @element.removeClass('hit'), 100) | |
p = (new_val/@enemy.starting_health) | |
@element.addClass('damaged') if p < 0.66 | |
@element.addClass('severely') if p < 0.33 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment