Esempio n. 1
0
    def test_pacman_PacMan_die_should_subtract_1_from_variable(self):
        # Arrange
        PacMan.die()

        # Act
        actual = PacMan.lives
        expected = 2

        # Assert
        self.assertEqual(actual, expected)
Esempio n. 2
0
            pacman2.image_index %= 4

        for pac in [pacman2, pacman1]:

            if pac.is_boosted:
                pac.is_boosted = False
                scared_ghost(pac)

        pacman2.draw()
        pacman1.draw()

        if is_touch(pacman2, pacman1):

            if pacman2.score > pacman1.score:

                if pacman1.die():
                    is_restart = True

                else:
                    is_game_over = True
                    winner = 1

                continue

            elif pacman2.score < pacman1.score:

                if pacman2.die():
                    is_restart = True

                else:
                    is_game_over = True