mercredi 7 juin 2017

Python If Statement Is Being Ignored

I've read some of the if statement questions already, but I don't really understand them.

I have this piece of code:

if fireUnlock == 1:
    if fireLevel == 1:
        icon.goto(screen_width / -5, 0)
        icon.shape(charfire)
        icon.showturtle()
        print '1'

elif fireUnlock == 0:
    if fireLevel == 0:
        turtle.goto(screen_width / -5, -100)
        turtle.write('(Unlock at LV 5)', align='Center', font=('04b03', '20'))
        icon.goto(screen_width / -5, 0)
        icon.shape(charblank)
        icon.showturtle()
        print '2'

elif fireUnlock == 0:
    if fireLevel == 1:
        turtle.goto(screen_width / -5, -100)
        turtle.write('Buy (300 Credits)', align='Center', font=('04b03', '20'))
        icon.goto(screen_width / -5, 0)
        icon.shape(charblank)
        icon.showturtle()
        print '3'

I've tried using an 'and' but it still didn't work. It's almost as if it just skips right over the if statement. I get no errors or any prints '1' '2' or '3'.

Help me please!

Aucun commentaire:

Enregistrer un commentaire