I have function which checks the score and will(I haven’t finished) increases level if the score hits the given score, my function:
def levels(Score):
if score >= 100:
enemies = 6
velocity = 2
and I’m calling it in the game loop:
levels(score)
The function never gets executed, my source code http://pastebin.com/JPZSTA6a
Line: 35-38 and 150
Thank you
The function is being called, but you are assigning to
enemiesandvelocityin the function, so they are local to the function, and are then discarded when the function returns. So your function is called, but has no lasting effect.You need to read about locals and globals in Python. As others point out you also have both
Scoreandscorehere. Python is case-sensitive, those are different names.