1 /****************************************************************************************** 2 * 3 * HighNoon - Duel in Space 4 * Copyright (c) 2005, 2006 Patrick Gerdsmeier <patrick@gerdsmeier.net> 5 * 6 * "constants.cpp" 7 * 8 * This file contains important parameters of the game. 9 * 10 * 11 * 12 * This program is free software; you can redistribute it and/or modify 13 * it under the terms of the GNU General Public License as published by 14 * the Free Software Foundation; either version 2, or (at your option) 15 * any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License 23 * along with this program; if not, write to the Free Software 24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 * 26 ******************************************************************************************/ 27 28 #ifndef __CONSTANTS_HPP__ 29 #define __CONSTANTS_HPP__ 30 31 #include <iostream> 32 33 #include <SDL.h> 34 35 //#define __DEBUG__ // Print out Some Debug Information 36 //#define __TRAINERMODE__ // Show Shootpath, toggle Weapon 37 //#define __THREADS__ // Tested Threads... didn't work faster =( 38 //#define __ENVIRONMENT__ // Has OS Environment? 39 40 const std::string VERSION = "1.2.4"; 41 const std::string COPYRIGHT = "Copyright (c) 2005, 2006 Patrick Gerdsmeier <patrick@gerdsmeier.net>"; 42 const std::string WEBSITE = "http://highmoon.gerdsmeier.net"; 43 44 const double PI = 3.141592; 45 46 // SCREEN 47 const int SCREENWIDTH = 1024; 48 const int SCREENHEIGHT = 768; 49 50 const int BORDERWIDTH = 70; 51 const int SCROLLBORDERWIDTH = 20; // Screen scrolls if shoot is above that line 52 const int SCROLLBACKSPEED = 10; // Steps to scroll back Screen 53 const int TICK_INTERVAL_SCREEN = 30; 54 const int TICK_INTERVAL_GAME = 30; 55 const int ANIMFRAME = 3; // Normal nth Frame is next Anim 56 const int BLINKTIME = 45; // For flashing Text 57 const int SCROLLERSPEED = 4; 58 const int _TITLETEXT = 10; 59 60 // KEYBOARD. I think this Keyboard functions are Ok: 61 const int KEY_DECSHOOT = SDLK_LEFT; 62 const int KEY_INCSHOOT = SDLK_RIGHT; 63 const int KEY_MOVEUP = SDLK_UP; 64 const int KEY_MOVEDOWN = SDLK_DOWN; 65 const int KEY_FIRE = SDLK_SPACE; 66 const int KEY_QUIT = SDLK_ESCAPE; 67 const int KEY_WARPGALAXY = SDLK_TAB; 68 const int KEY_CHOOSEBONUS = SDLK_RETURN; 69 const int KEY_TOGGLEFULLSCREEN = SDLK_f; 70 const int KEY_TOGGLESCROLLER = SDLK_F1; 71 const int KEY_TOGGLELANGUAGE = SDLK_F2; 72 const int KEY_SCREENSHOT = SDLK_F12; 73 const int UKEY_ONEPLAYER = 48+1; // For french Keyboard 74 const int UKEY_TWOPLAYER = 48+2; 75 const int UKEY_DEMO = 48+3; 76 const int KEY_STRENGTH = SDLK_c; 77 const int KEY_TOGGLESOUND = SDLK_s; 78 const int KEY_TOGGLEHINT = SDLK_h; // undocumented feature, built in for testing only... = ) 79 const int KEY_NEXTWEAPON = SDLK_n; // undocumented feature, built in for testing only... = ) 80 81 // GAME+GALAXY 82 const int MAXPLAYER = 2; // Don't change! (Actually?) only 2 Players are supported 83 const int MAXENERGY = 100; 84 const int WINNINGWAIT = 400; // Frames to wait if Game has a Winner 85 86 const int MAXHOLE = 60; // Pixels in Blackholes 87 const int MAXWORM = 150; // Pixels in Wormholes 88 const int MAXGOLDRAIN = 150; // Pixels in Goldrain 89 const int MAXSTARS = 100; // Stars in Background 90 91 // WEAPONS 92 const int MAXCLUSTERLASER = 5; 93 const int CLUSTERLASERANGLE = 30; 94 enum WeaponId { 95 WEAPON_LASER = 0, 96 WEAPON_HEAVY = 1, 97 WEAPON_CLUSTER = 2, 98 WEAPON_FUNGHI = 3 99 }; 100 101 // PLANETS 102 const int MAXPLANETS = 9; // max. Planets in a Galaxy 103 const int MINPLANETS = 5; // min. -"- 104 const int WEIGHT_JUPITER = 350; // Weight is important for the gravity! 105 const int WEIGHT_EARTH = 300; 106 const int WEIGHT_MARS = 200; 107 const int WEIGHT_VENUS = 180; 108 const int WEIGHT_SATURN = 250; 109 const int WEIGHT_BLACKHOLE = -100; 110 const int WEIGHT_WORMHOLE = 100; 111 const int MAXSTONES = 35; 112 113 // SHOOT 114 const int MAXSHOOTS = 1; // Shoots per Player (Don't change!) 115 const int MAXSHOOTPOWER = 100; // 1..100 116 const int SHOOTPOWERFACTOR = 3; 117 const int MAXSHOOTRUN = 700; // max. Frames a Shoot should run 118 const int SHOOT_INTERVAL = 30; 119 120 // COMPUTER 121 const int MAXCOMPUTERSEARCH = 150; // Amount of paths the computer explores for shooting. 122 const int MAXPRECALC = MAXSHOOTRUN; // How deep should the computer think. 123 124 // SOUND 125 const int NUMBEROFCHANNELS = 4; 126 static const int _SOUNDSETNAMES = 8; 127 enum SoundId { 128 SOUND_EXPLOSION = 0, 129 SOUND_SHOOT = 1, 130 SOUND_WINNINGGAME = 2, 131 SOUND_WARPGALAXY = 3, 132 SOUND_HITUFO = 4, 133 SOUND_NEWGAME = 5, 134 SOUND_NEWEXTRA = 6, 135 SOUND_BUYWEAPON = 7 136 }; 137 138 extern void verbose( std::string info ); 139 140 #define RANDOM(max,min) ((max-min)*(rand()/(RAND_MAX+1.0))+min) 141 142 #define SCREAM(t) std::cout << t << std::endl << std::flush; 143 144 145 #endif 146 147