I would like this code to be changed so that whenever I change the line the line will still be a wall...

    slin1_1 = 320
    slin1_2 = 0
    elin1_1 = 320
    elin1_2 = 200
    strtlin1 = (slin1_1, slin1_2)
    endlin1 = (elin1_1, elin1_2)
    lin1sz = 1
    #creates first line above ^


    slin2_1 = 320
    slin2_2 = 400
    elin2_1 = 320
    elin2_2 = 300
    strtlin2 = (slin2_1, slin2_2)
    endlin2 = (elin2_1, elin2_2)
    lin2sz = 1

    #creates second line above

    if x <= 0 or x >= width or y <= 0 or y >= height:
        print( "Crash!!!" )
        running = False
        a += 1

    for i in range(0, 49):

        if x + i == slin1_1 and (y <=200 or y >=300):
            print( "Crash!!!" )
            running = False
            a +=1

^^^^^^^^ the above lines needs to be changed to allow the changing of lines ^^^^^^^^^^^^^
if x + i == winpos1 and (y >= winpos2 and y <= winpos2):
print"Winner"
running = False

       if x + i == slin2_1 and (y + 48 <=200 or y + 48 >=300):
            print( "Crash!!!" )
            running = False
            a += 1

^^^^^^^^ the above line needs to be changed to allow the changing of lines ^^^^^^^^^^^^^

        if  x + i == winpos1  and (y + 48 >= winpos2 and y + 48 <= winpos2):
            print"Winner"
            running = False

        if  x == winpos1  and (y + i >= winpos2 and y + i <= winpos2):
            print"Winner"
            running = False

        if  x + 48 == winpos1  and (y + i >= winpos2 and y + i <= winpos2):
            print"Winner"
            running = False

Edited 4 Years Ago by Twin802

you have many undefined and unused/unnecessary variables. Especially clumsy are first lines. Also the variable names are cryptic.

Comments
This doesn't help me at all...

THAT IS NO HELP WHATSOEVER!!! Fyi (for your information) all the variables are defined and if they aren't then they're defined in the full script any variable not defined is not needed now I need someone to fix the code so that the lines are walls no matter how the lines are changed!!!!!!!!

Edited 4 Years Ago by Twin802

This article has been dead for over six months. Start a new discussion instead.