So, the indentation is a problem...that isn't the biggest problem, you are misunderstanding how to put together an if statement.
This:
means:
If day equals 30, or if 60 is True. And 60 is a number that isn't 0, so it is always true...so this whole line will always be true and you will always have rent due.
To get what you want, you'd have to write it all out by hand like so:
So, for your code, you'd want:
Code: Select all
if day == 30 or day == 60 or day == 90 or day == 120 or day == 150 or day == 180 or day == 210 or day == 240 or day == 270 or day == 300 or day == 330 or day == 360:
pov "I have to pay my rent today."
if money >= 500:
$ money -=500
pov "I could pay my rent this time."
else:
pov "I don't have enough money!\nHow can this be...?!"
#Game Over
return
elif day == 365:
pov "The End"
return
else:
pass
Or you could put in parenthesis to make clear what you mean:
Now both of those options get pretty long and would be irritating if you had to type that out multiple times. So you can do some other options. For example, you could make a list with all the values when the rent is due and then check to see if the day is in the list. That would look like this:
Code: Select all
default rentdays = [30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360]
# The game starts here.
label start:
if day in rentdays:
pov "I have to pay my rent today."
if money >= 500:
$ money -=500
pov "I could pay my rent this time."
else:
pov "I don't have enough money!\nHow can this be...?!"
#Game Over
return
elif day == 365:
pov "The End"
return
else:
pass
Another option? I noticed that all of your rent days are divisible by 30. So instead of having a list, you could just check to see if the remainder after dividing days by 30 is 0. If it is, you know you have one of your rent days. Like so:
Code: Select all
label start:
if day > 0 and day%30 == 0:
pov "I have to pay my rent today."
if money >= 500:
$ money -=500
pov "I could pay my rent this time."
else:
pov "I don't have enough money!\nHow can this be...?!"
#Game Over
return
elif day == 365:
pov "The End"
return
else:
pass
So...just be thoughtful
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe:
http://lemmasoft.renai.us/forums/viewto ... 51&t=21978