Help with the if statement?
Posted: Sun Apr 13, 2014 12:08 am
So I am attempting to make a game but I really wanna know how to use the if statement so I can make it easier on myself. I've read over the help and tutorials on the ren'py wiki but it never works. This is the menu I want to do using the if statement,
menu:
"\"The Dresser\"":
$ Sword = True
jump dresser
"\"The Bag\"":
$ Bow_Arrow = True
jump bag
"\"Under the Bed\"":
$ Tomahawk = True
jump bed
and then when I do this,
menu:
"Use which?"
"The Sword" if Sword == True:
"I run towards him slamming my sword against him"
$ Selo_Health -= 2
"Suddenly, he punches my gut before I can dodge him"
$ Heather_Health -= 1
jump sa1
"The Bow and Arrows" if Bow_Arrow == True:
"I pulled back an arrow but miss and hit him in the arm instead"
$ Selo_Health -= 2
"He tries to run towards me to hit me but I quickely move away"
jump sa1
"The Tomahawk" if Tomahawk == True:
"I run as fast as I can and slam him with the tomahawk"
$ Selo_Health -= 5
"But then he smacks me in the side, catching me off guard. While I'm still down he kicks me"
$ Heather_Health -= 3
jump sa1
it tells me that Sword, Bow_Arrow, and Tomahawk aren't defined but I don't know what that means. I thought I defined them already but I guess I didn't so how do I do that?
menu:
"\"The Dresser\"":
$ Sword = True
jump dresser
"\"The Bag\"":
$ Bow_Arrow = True
jump bag
"\"Under the Bed\"":
$ Tomahawk = True
jump bed
and then when I do this,
menu:
"Use which?"
"The Sword" if Sword == True:
"I run towards him slamming my sword against him"
$ Selo_Health -= 2
"Suddenly, he punches my gut before I can dodge him"
$ Heather_Health -= 1
jump sa1
"The Bow and Arrows" if Bow_Arrow == True:
"I pulled back an arrow but miss and hit him in the arm instead"
$ Selo_Health -= 2
"He tries to run towards me to hit me but I quickely move away"
jump sa1
"The Tomahawk" if Tomahawk == True:
"I run as fast as I can and slam him with the tomahawk"
$ Selo_Health -= 5
"But then he smacks me in the side, catching me off guard. While I'm still down he kicks me"
$ Heather_Health -= 3
jump sa1
it tells me that Sword, Bow_Arrow, and Tomahawk aren't defined but I don't know what that means. I thought I defined them already but I guess I didn't so how do I do that?