terom@185: #ifndef CONFIG_HH terom@185: #define CONFIG_HH terom@185: terom@220: // XXX: merge this as Config.hh.in? terom@220: #include "config.h" terom@220: terom@300: #include "Types.hh" terom@300: terom@185: #include terom@185: terom@185: // This is a temporary way to declare different constants. Maybe we terom@185: // should do somekind of resource manager? Do we have time? terom@185: terom@283: /** terom@283: * The value of pi used in physics/graphics calculations terom@283: */ terom@185: const float KG_PI = 3.14159265; terom@185: terom@185: // Physics simulation terom@185: // Physics resolution terom@266: const uint16_t MAP_WIDTH = 1000; terom@266: const uint16_t MAP_HEIGHT = 800; terom@185: const float MAP_SCALE = 1; // One "pixel" in "real" units terom@266: terom@380: /** Engine timeout, this determines our minimum tick rate */ terom@380: const TimeMS ENGINE_TIMEOUT_MS = 10; terom@380: terom@380: /** Physics tick interval */ terom@380: const TimeMS PHYSICS_TICK_MS = 10; terom@185: terom@311: /** Input handling keyboard poll interval */ terom@311: const TimeMS INPUT_POLL_INTERVAL = 10; terom@311: terom@311: /** How long to block INPUT_FLAG_NOREPEAT for */ terom@311: const TimeMS INPUT_REPEAT_DELAY = 250; terom@311: terom@283: /** terom@283: * The force of gravity on objects, exerted on the Y axis terom@283: */ ekku@214: const float MAP_GRAVITY = 1500.0; terom@185: terom@185: // Player properties terom@185: const float PLAYER_MASS = 10.0; nireco@219: const float PLAYER_MOVE_FORCE = 1100.0; nireco@219: const float PLAYER_MIN_SPEED = 10.0; terom@185: const float PLAYER_JUMP_MIN_DISTANCE = 5.0; saiam@258: const float PLAYER_AIM_MIN = -3*KG_PI/8; terom@185: const float PLAYER_AIM_MAX = KG_PI/2; terom@185: const float PLAYER_INITIAL_X = 400.0; terom@185: const float PLAYER_INITIAL_Y = 300.0; terom@261: const float PLAYER_CROSSHAIR_DISTANCE = 20.0; terom@261: const float PLAYER_CROSSHAIR_WIDTH = 4; saiam@293: const float CROSSHAIR_ANGLE_SPEED = PI/2000; terom@185: nireco@219: const float PLAYER_MAX_SPEED = 43; nireco@219: const float PLAYER_WALK_SPEED = 33; nireco@188: ekku@214: const float PLAYER_COLLISION_ELASTICITY = 0.25; // TODO: This could be nireco@188: // different for different nireco@188: // objects nireco@288: const float PLAYER_RADIUS = 10; terom@185: terom@300: /** What size of hole to dig */ terom@300: const float PLAYER_DIG_RADIUS = 15; terom@300: terom@300: /** Player's initial health */ terom@300: const Health PLAYER_HEALTH = 100; terom@300: terom@300: /** How long to wait after dying to respawn */ terom@300: const TimeMS PLAYER_RESPAWN_DELAY = 2500; terom@300: terom@276: /* terom@276: * Projectiles terom@276: */ terom@276: terom@276: // object mass... terom@276: const float PROJECTILE_MASS = 10.0; terom@276: terom@235: // how far away from the player the projectile spawns terom@235: const float PROJECTILE_START_DISTANCE = 10.0; terom@235: terom@276: /* terom@377: * @name Rope terom@377: * @{ terom@276: */ terom@276: terom@377: /** How much to grow the rope length by on every ROPE_UP/DOWN */ terom@235: const float ROPE_GROWTH_RATE = 5; terom@276: terom@377: /** The force that the rope exerts on the player when the length is too long */ terom@235: const float ROPE_FORCE = 3500; terom@276: terom@377: /** Same as player mass...? */ terom@276: const float ROPE_MASS = 10.0; terom@276: terom@377: /** Initial rope length... this should probably be a bit more dynamic? */ terom@235: const float ROPE_LENGTH = 100.0; terom@276: terom@377: /** Initial velocity of the rope when thrown */ terom@235: const float ROPE_VELOCITY = 500; terom@235: terom@377: /** terom@377: * Rope colors, it should alternate between these two terom@377: */ terom@377: const CL_Color ROPE_COLOR_LIGHT = CL_Color(198, 100, 2); terom@377: const CL_Color ROPE_COLOR_DARK = CL_Color(159, 79, 1); terom@377: terom@377: // @} terom@377: terom@185: // Graphical properties terom@185: const CL_Color COLOR_EMPTY(86, 41, 0); terom@185: const CL_Color COLOR_DIRT(144, 82, 23); terom@185: const CL_Color COLOR_ROCK(132, 136, 135); terom@185: terom@266: // graphics params terom@397: const std::string GRAPHICS_WINDOW_TITLE = PROJECT_LONG_NAME; /* (PROJECT_LONG_NAME " : Version " PROJECT_VERSION); */ terom@266: const uint32_t GRAPHICS_RESOLUTION_WIDTH = 800; terom@266: const uint32_t GRAPHICS_RESOLUTION_HEIGHT = 600; terom@266: const uint16_t GRAPHICS_UPDATE_INTERVAL_MS = 20; terom@389: const bool GRAPHICS_FULLSCREEN = false; terom@266: terom@393: /** terom@393: * Number of pixels between lines terom@393: */ terom@393: const PixelDimension GRAPHICS_INFO_TEXT_LINE_OFFSET = 5; terom@266: terom@266: // Filesystem paths terom@220: const std::string PLAYER_SKIN_PATH = (PROJECT_DATA_DIR "/skin.png"); terom@233: const std::string RESOURCE_XML_PATH = (PROJECT_DATA_DIR "/resources.xml"); terom@220: terom@185: #endif