Beispiel #1
0
    def __init__(self):
        """Initialise pyxel and various classes and variables (one off)."""

        pyxel.init(200, 200, scale=2)
        self.ship = Ship(*constants.SHIP_INITIAL_POSITION,
                         constants.SHIP_COLOUR)
        Asteroid.init_class(self.ship)
        sound.init_music()

        self.reset_game()
        self.high_score = get_highscore(constants.HIGH_SCORE_FILE)

        pyxel.run(self.update, self.draw)
Beispiel #2
0
    def __init__(self, child_con):
        """Initialise pyxel and various classes and variables (one off)."""

        pyxel.init(200, 200, scale=2)
        pyxel.mouse(True)
        self.ship = Ship(*constants.SHIP_INITIAL_POSITION, constants.SHIP_COLOUR)
        Asteroid.init_class(self.ship)
        sound.init_music()
        self.child_con = child_con # for multiprocessing sharing data thru a pipe
        self.reset_game()
        self.high_score = get_highscore(constants.HIGH_SCORE_FILE)

        pyxel.run(self.update, self.draw)