PowerUps_TestField.py
def generatePowerUp(t=10, s=0):  # Switches
    """ Switches: if t > 0 then it will check the time, if s is not 0 it will check the score
        both can be activated at once. """
    # ----------Switches Logic-------------
    if (t > 0) and (s != 0):
        currentCheck = checkForScore(s) or checkForTime(t)
    elif t > 0:
        currentCheck = checkForTime(t)
    elif s != 0:
        currentCheck = checkForScore(s)
    else:
        currentCheck = False
    # -------------------------------------

    generate = False
    if currentCheck is True:
        #print("💃💃💃💃💃💃💃💃💃💃💃💃💃💃 powerup successfully generated 💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃")
        #print(currentScore)
        generate = True
    else:
        generate = False

    global collectedPowerUps
    listOfPowerUps = ["NeutrinoBomb", "Laser Gun", "Kalaxian Crystal", "Yummy Yum's"]
    if generate:
        chosenPowerup = randint(0, 3)               # Choose one of the four powerups
        if chosenPowerup == 0:                      # If Neutrino Bomb was chosen: check for collectibles
            if collectedPowerUps == [1, 1, 1]:      # All collectibles where collected and NeutrinoBomb is available
                chosenPowerup = randint(1, 3)       # to player, now choose from the rest powerups
                return chosenPowerup                # ("Laser Gun", "Kalaxian Crystal", "Yummy Yum's")
            elif collectedPowerUps == [0, 0, 0]:    # If collectibles where still not collected, generate one.
                chosenPowerup = 4
                collectedPowerUps = [1, 0, 0]       # Now I've collected one
                return chosenPowerup
            elif collectedPowerUps == [1, 0, 0]:
                chosenPowerup = 5
                collectedPowerUps = [1, 1, 0]       # Now I've collected two
                return chosenPowerup
            elif collectedPowerUps == [1, 1, 0]:
                chosenPowerup = 6
                collectedPowerUps = [1, 1, 1]       # Now I've collected all of them, go to comment line 83-85
                return chosenPowerup
        else:
            return chosenPowerup
    else:
        return False
 Switches: if t > 0 then it will check the time, if s is not 0 it will check the score
        both can be activated at once. 
if t > 0 then it will check the time, if s is not 0 it will check the score
both can be activated at once.
if t > 0 then it will check the time if s is not 0 it will check the score both can be activated at once .
def generatePowerUp(t=10, s=0):  
    if (t > 0) and (s != 0):
        currentCheck = checkForScore(s) or checkForTime(t)
    elif t > 0:
        currentCheck = checkForTime(t)
    elif s != 0:
        currentCheck = checkForScore(s)
    else:
        currentCheck = False
    generate = False
    if currentCheck is True:
        generate = True
    else:
        generate = False
    global collectedPowerUps
    listOfPowerUps = ["NeutrinoBomb", "Laser Gun", "Kalaxian Crystal", "Yummy Yum's"]
    if generate:
        chosenPowerup = randint(0, 3)               
        if chosenPowerup == 0:                      
            if collectedPowerUps == [1, 1, 1]:      
                chosenPowerup = randint(1, 3)       
                return chosenPowerup                
            elif collectedPowerUps == [0, 0, 0]:    
                chosenPowerup = 4
                collectedPowerUps = [1, 0, 0]       
                return chosenPowerup
            elif collectedPowerUps == [1, 0, 0]:
                chosenPowerup = 5
                collectedPowerUps = [1, 1, 0]       
                return chosenPowerup
            elif collectedPowerUps == [1, 1, 0]:
                chosenPowerup = 6
                collectedPowerUps = [1, 1, 1]       
                return chosenPowerup
        else:
            return chosenPowerup
    else:
        return False
def generatePowerUp ( t = 10 , s = 0 ) : if ( t > 0 ) and ( s != 0 ) : currentCheck = checkForScore ( s ) or checkForTime ( t ) elif t > 0 : currentCheck = checkForTime ( t ) elif s != 0 : currentCheck = checkForScore ( s ) else : currentCheck = False generate = False if currentCheck is True : generate = True else : generate = False global collectedPowerUps listOfPowerUps = [ "NeutrinoBomb" , "Laser Gun" , "Kalaxian Crystal" , "Yummy Yum's" ] if generate : chosenPowerup = randint ( 0 , 3 ) if chosenPowerup == 0 : if collectedPowerUps == [ 1 , 1 , 1 ] : chosenPowerup = randint ( 1 , 3 ) return chosenPowerup elif collectedPowerUps == [ 0 , 0 , 0 ] : chosenPowerup = 4 collectedPowerUps = [ 1 , 0 , 0 ] return chosenPowerup elif collectedPowerUps == [ 1 , 0 , 0 ] : chosenPowerup = 5 collectedPowerUps = [ 1 , 1 , 0 ] return chosenPowerup elif collectedPowerUps == [ 1 , 1 , 0 ] : chosenPowerup = 6 collectedPowerUps = [ 1 , 1 , 1 ] return chosenPowerup else : return chosenPowerup else : return False
Switches: if t > 0 then it will check the time, if s is not 0 it will check the score
both can be activated at once.
Switches : if t > 0 then it will check the time if s is not 0 it will check the score both can be activated at once .
# Switches """ Switches: if t > 0 then it will check the time, if s is not 0 it will check the score
        both can be activated at once. """ # ----------Switches Logic------------- # ------------------------------------- #print("💃💃💃💃💃💃💃💃💃💃💃💃💃💃 powerup successfully generated 💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃💃") #print(currentScore) # Choose one of the four powerups # If Neutrino Bomb was chosen: check for collectibles # All collectibles where collected and NeutrinoBomb is available # to player, now choose from the rest powerups # ("Laser Gun", "Kalaxian Crystal", "Yummy Yum's") # If collectibles where still not collected, generate one. # Now I've collected one # Now I've collected two # Now I've collected all of them, go to comment line 83-85
t
s