Make the world/plane type configurable
This commit is contained in:
parent
7ecf57c7c0
commit
492a2804c8
1 changed files with 7 additions and 7 deletions
|
@ -32,6 +32,12 @@ namespace TappyPlane {
|
|||
using SpriteName = std::tuple<std::string_view, std::string_view>;
|
||||
using SpriteMap = std::unordered_map<std::string_view, paradiso::Bitmap>;
|
||||
|
||||
enum class WorldType { Dirt, Grass, Ice, Rock, Snow };
|
||||
enum class PlaneType { Blue, Green, Red, Yellow };
|
||||
|
||||
static const WorldType WORLD_TYPE = TappyPlane::WorldType::Grass;
|
||||
static const PlaneType PLANE_TYPE = TappyPlane::PlaneType::Red;
|
||||
|
||||
static const unsigned int FRAME_RATE = 60;
|
||||
|
||||
static const unsigned int WINDOW_WIDTH = 800;
|
||||
|
@ -556,9 +562,6 @@ enum class GameState { Start, Playing, GameOver };
|
|||
struct App {
|
||||
SpriteMap sprites;
|
||||
|
||||
enum class WorldType { Dirt, Grass, Ice, Rock, Snow };
|
||||
enum class PlaneType { Blue, Green, Red, Yellow };
|
||||
|
||||
static auto create(WorldType world_type = WorldType::Grass,
|
||||
PlaneType plane_type = PlaneType::Red) -> App {
|
||||
auto app = App{};
|
||||
|
@ -815,10 +818,7 @@ struct App {
|
|||
auto main() -> int {
|
||||
std::srand(std::time(nullptr));
|
||||
|
||||
auto world_type = TappyPlane::App::WorldType::Grass;
|
||||
auto plane_type = TappyPlane::App::PlaneType::Red;
|
||||
|
||||
auto app = TappyPlane::App::create(world_type, plane_type);
|
||||
auto app = TappyPlane::App::create(TappyPlane::WORLD_TYPE, TappyPlane::PLANE_TYPE);
|
||||
app.run();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue