src/Config.hh
author terom
Mon, 08 Dec 2008 21:18:08 +0000
changeset 311 440763821484
parent 300 417183866f35
child 377 01d3c340b372
permissions -rw-r--r--
make Input have its own timer, and add key-repeat handling, and fix some warnings
#ifndef CONFIG_HH
#define CONFIG_HH

// XXX: merge this as Config.hh.in?
#include "config.h"

#include "Types.hh"

#include <ClanLib/display.h>

// This is a temporary way to declare different constants. Maybe we
// should do somekind of resource manager? Do we have time?

/**
 * The value of pi used in physics/graphics calculations
 */
const float KG_PI = 3.14159265;

// Physics simulation
// Physics resolution
const uint16_t MAP_WIDTH = 1000;
const uint16_t MAP_HEIGHT = 800;
const float MAP_SCALE = 1; // One "pixel" in "real" units

// Simulation
const uint16_t PHYSICS_TICK_MS = 10;

/** Input handling keyboard poll interval */
const TimeMS INPUT_POLL_INTERVAL = 10;

/** How long to block INPUT_FLAG_NOREPEAT for */
const TimeMS INPUT_REPEAT_DELAY = 250;

/**
 * The force of gravity on objects, exerted on the Y axis
 */
const float MAP_GRAVITY = 1500.0;

// Player properties
const float PLAYER_MASS = 10.0;
const float PLAYER_MOVE_FORCE = 1100.0;
const float PLAYER_MIN_SPEED = 10.0;
const float PLAYER_JUMP_MIN_DISTANCE = 5.0;
const float PLAYER_AIM_MIN = -3*KG_PI/8; 
const float PLAYER_AIM_MAX = KG_PI/2;
const float PLAYER_INITIAL_X = 400.0;
const float PLAYER_INITIAL_Y = 300.0;
const float PLAYER_CROSSHAIR_DISTANCE = 20.0;
const float PLAYER_CROSSHAIR_WIDTH = 4;
const float CROSSHAIR_ANGLE_SPEED = PI/2000;

const float PLAYER_MAX_SPEED = 43;
const float PLAYER_WALK_SPEED = 33;

const float PLAYER_COLLISION_ELASTICITY = 0.25; // TODO: This could be
                                        // different for different
                                        // objects
const float PLAYER_RADIUS = 10;

/** What size of hole to dig */
const float PLAYER_DIG_RADIUS = 15;

/** Player's initial health */
const Health PLAYER_HEALTH = 100;

/** How long to wait after dying to respawn */
const TimeMS PLAYER_RESPAWN_DELAY = 2500;

/*
 * Projectiles
 */

// object mass...
const float PROJECTILE_MASS = 10.0;

// how far away from the player the projectile spawns
const float PROJECTILE_START_DISTANCE = 10.0;

/*
 * Rope
 */

// how much to grow the rope length by on every ROPE_UP/DOWN
const float ROPE_GROWTH_RATE = 5;

// the force that the rope exerts on the player when the length is too long
const float ROPE_FORCE = 3500;

// same as player mass...?
const float ROPE_MASS = 10.0;

// initial length... this should probably be a bit more dynamic?
const float ROPE_LENGTH = 100.0;

// initial velocity of the rope when thrown
const float ROPE_VELOCITY = 500;

// Graphical properties
const CL_Color COLOR_EMPTY(86, 41, 0);
const CL_Color COLOR_DIRT(144, 82, 23);
const CL_Color COLOR_ROCK(132, 136, 135);

// graphics params
const std::string GRAPHICS_WINDOW_TITLE = "Kisna Glista";
const uint32_t GRAPHICS_RESOLUTION_WIDTH = 800;
const uint32_t GRAPHICS_RESOLUTION_HEIGHT = 600;
const uint16_t GRAPHICS_UPDATE_INTERVAL_MS = 20;


// Filesystem paths
const std::string PLAYER_SKIN_PATH = (PROJECT_DATA_DIR "/skin.png");
const std::string RESOURCE_XML_PATH = (PROJECT_DATA_DIR "/resources.xml");

#endif