Exemple #1
0
 def checkPacmanCollide(self, pacman):
     '''Check for collision between Pacman and ghost'''
     if collided(self, pacman):
         if not self.modeUpdater.inFleeMode():
             if self.modeUpdater.inFreightMode():
                 self.modeUpdater.overideMode()
                 self.sendHome()
             else:
                 pacman.alive = False
Exemple #2
0
 def checkCollided(self, pacman):
     '''Update pellets by checking for collision with Pacman.  
     Also return whether the collision was with a power pellet'''
     pList = [p for p in self.pelletList if p.alive]
     for pellet in pList:
         if collided(pacman, pellet):
             self.numEaten += 1
             self.numEatenTotal += 1
             pellet.alive = False
             if pellet.type == POWERPELLET:
                 return True
     return False
    # Moving the player.
    player.fall()
    player.prev_click = player.time
    player.time += 1

    # Rotate the player.
    #prev_cid = cid
    #cid = player.prev_position - player.position
    #print(cid)
    #print(rad)
    #bird = pygame.transform.rotate(bird, )

    gameDisplay.blit(bird, (50, player.position))

    # Frame by frame updating.
    pygame.display.update()
    clock.tick(FPS)

    # Collion Detection.
    if collision.collided(
        [50, int(player.position),
         bird.get_rect()[2],
         bird.get_rect()[3]], pipes):
        print "You Died!, Score = " + str(distance)
        game_exit = True
        time.sleep(1)

    elapsed_time += 1

quit()