forked from gever/bwx-adventure
-
Notifications
You must be signed in to change notification settings - Fork 1
Handy Dandy Examples for Difficult Code
sleepinghungry edited this page Jan 17, 2017
·
1 revision
def final_words(game, thing):
thing.health -= 1
if thing.health == 2:
game.output("The character doesn't look good. It says, \"I don't feel very good.\"")
elif thing.health == 1:
game.output("The character closes its eyes and whispers, \"I should've been a game designer.\"")
elif thing.health == 0:
game.output("The character doesn't respond.")
elif thing.health < 0:
game.output("The character has died.")
actor_or_animal_variable.add_phrase("chat", final_words)
This code is easily edited to handle fighting by changing "chat" to "fight" or "kill"