Exemple #1
0
 def __init__(self):
     """
     @rtype: None
     """
     self.current_opts = load_options()
     self.layer = [self.current_opts["LAYER0"], self.current_opts["LAYER1"]]
     self.layer = [self.ParallaxScrollingLayer(load_image(e, (900, 720))) for e in self.layer]
     self.radio = 2
    def __init__(self):
        """
        @rtype: None
        """
        # generate a random seed
        seed = random.randrange(maxsize)

        state_game.StateGame.__init__(self, load_options(),
                                      ["GAME", "MAIN_MENU"], seed)

        self.replay = rp.Replay(seed=seed)
        self.replay.set_opts(self.current_opts)
Exemple #3
0
    def __init__(self, items, seed):
        """
        Initialize the Map object.
        @param items: the item manager, possibly none
        @param seed: the seed, possibly none
        """
        self.dim_bloc = 80

        self.height = 720 // self.dim_bloc
        self.width = 4800 // self.dim_bloc
        self.display_width = 1200 // self.dim_bloc
        # An important note : both of pos and gen aint on the same scale, self.gen is a number of bloc when self.pos is
        # a matter of px. Those should not be compared without a self.dim_bloc factor
        self.pos = 0
        self.gen = 0
        self.gen_level = 1

        self.current_opts = load_options()
        self.difficulty = self.current_opts["DIFFICULTY"]

        self.data = np.full((self.width, self.height),
                            Material.EMPTY,
                            dtype=Material)

        for i in range(self.display_width):
            self.data[i, self.height - 1] = Material.GROUND
            self.gen += 1

        self.display_init = False

        self.last_dx = 0

        self.need_antidote = 0

        if seed is None:
            self.seed_init = rd.randint(1, CONST_LEHMER_N - 1)
        else:
            self.seed_init = max(int(seed) % CONST_LEHMER_N, 1)

        self.seed = self.seed_init

        self.items = items
 def __init__(self):
     """
     @rtype: None
     """
     state_engine.GameState.__init__(self)
     self.current_select = 0
     self.all_opts = {
         "CHARACTER": ["mario", "luigi", "toad", "peach"],
         "DIFFICULTY": ["none", "easy", "normal", "difficult", "expert"],
         "NUMBER_OF_PLAYER": [1, 2],
         "LAYER0": ["layer0/0.png", "layer0/1.png"],
         "LAYER1": ["layer1/0.png", "layer1/1.png"]
     }
     self.current_opts = load_options()
     for elem in self.current_opts.keys():
         self.current_opts[elem] = self.all_opts[elem].index(
             self.current_opts[elem])
     self.available_opts = list(self.all_opts)
     self.available_opts.sort()
     self.options_map = Map(None, None)