Пример #1
0
        for iterationnbReversed in range(nbReversed):
            """-----------QUIT, LOOP PYGAME -----------"""
            #pygame.time.Clock().tick(30)
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    continuer = 0
            """----------- LUNCH WINDOW DISPLAY -----------"""
            #Reput map.
            game.displayingWindow()
            game.generatingMap(window)
            """---------EXPLORATION or EXPLOITATION ---------"""
            """      (selection of the next movement)        """

            coordinate0 = dkPersonnage.getterCoordinates()  #T
            exploration = QLearning.epsilonGreedy()

            currentExplo = QLearning.getterExploration()
            """--------- KNN ---------"""
            #Recuperate coord of enemy shot.
            shotCoord = shotEnemy.getterCoordinates(currentExplo)
            #ask right and top cood of location of dk.
            dkPersonnage.rayon()
            #Detection dk enemy shot with top right coord and enemy coord.
            detectionRayon = dkPersonnage.detectionShot(shotCoord)
            """--------- MOVE FROM MODEL ---------"""
            #Verify detection
            noMove = False
            immediateMove = False

            if detectionRayon[0] != None: