MitchellSternke / Mario

A C++ clone of the classic Super Mario Bros. games.
320 stars 104 forks source link

Request: document how to run a real level #2

Open richelbilderbeek opened 7 years ago

richelbilderbeek commented 7 years ago

When I run the game, I get an 'Infinite level' with a 1UP and then nothing. Whereas in the resources I see that there are the building blocks of all enemies/blocks/map/etc present.

I hope you will briefly document how to get to use these and play a real level or game.

MitchellSternke commented 6 years ago

Hi @richelbilderbeek,

You can enable other level generators by uncommenting the push_back statements in InfinityState.cpp:

    void InfinityState::generateNewLevel()
    {
        ...
        // Generate a new level
        std::vector<LevelGenerator*> generators;
        //generators.push_back(new SimpleLevelGenerator);
        //generators.push_back(new HillyLevelGenerator);
        //generators.push_back(new SmbLevelLoader);
        generators.push_back(new TestLevelGenerator);

The SimpleLevelGenerator and HillyLevelGenerator are the ones you are looking for (SmbLevelLoader requires other level data files). You can even create and enable your own level generator by inheriting the LevelGenerator class and adding it to this vector.