Module constants
[hide private]
[frames] | no frames]

Source Code for Module constants

  1  ''' 
  2  constants.py 
  3  stores any variables that are constant to the entire game 
  4  ''' 
  5   
  6  from pyglet.window import key 
  7   
  8  '''GAME OPTIONS''' 
  9  WINDOW_WIDTH = 1024 
 10  WINDOW_HEIGHT = 768 
 11  FULL_SCREEN = False 
 12  MAP_FILE = "level1.map" 
 13  SHOW_TUTORIAL = True 
 14  SCROLL_CONST = 1000 
 15  DEFAULT_ACTION_DURATION = 10 
 16  BLEED = 200.0 
 17  STATUS_BAR_HEIGHT = 70 
 18  SOUND = True 
 19  MUSIC = True 
 20   
 21  MULTIPLAYER = False 
 22   
 23  DEFAULT_MAP = "level1" 
 24  DEFAULT_MULT_MAP = "mult2" 
 25   
 26  BUILDING_HOTKEYS = { 
 27      key.Q: 7,  # Q 
 28      key.W: 3,  # W 
 29      key.E: 5,  # E 
 30      key.A: 1,  # A 
 31      key.D: 0,  # D 
 32      key.Z: 6,  # Z 
 33      key.X: 2,  # X 
 34      key.C: 4,  # C 
 35  } 
 36   
 37  TROOP_HOTKEYS = { 
 38      key.A: 0,  # A 
 39      key.S: 1,  # S 
 40      key.D: 2  # D 
 41  } 
 42   
 43  '''MENU OPTIONS''' 
 44  BUTTON_FONT_HEIGHT = 24 
 45  ACTION_BUTTON_WIDTH = 40 
 46   
 47  '''MULTIPLAYER OPTIONS''' 
 48  #SERVER_IP = "137.22.234.214" 
 49  #SERVER_IP="10.0.1.2" 
 50  #SERVER_IP = "137.22.30.170" 
 51  #SERVER_IP = "137.22.167.19" 
 52  SERVER_IP = "137.22.4.80" 
 53   
 54  '''COLORS_OPTIONS''' 
 55  GAME_BG_COLOR = (255, 255, 255) 
 56  EDGE_COLOR = (80, 80, 80, 155) 
 57  AS_EDGE_COLOR = (80, 80, 130, 155) 
 58  MAP_BG_COLOR = (255, 255, 255) 
 59  PLAYER_COLORS = [(200,30,30),(60,60,60),(168,107,57),(34,101,101)] 
 60  #PLAYER_COLORS = [(255,255,255),(255,255,255),(255,255,255),(255,255,255)] 
 61  AS_COLORS = [(155, 155, 155), (100, 100, 100),(155, 155, 155),(155, 155, 155),(155, 155, 155),(155, 155, 155)] 
 62  ADJ_EDGE_COLOR = (80, 130, 80, 155) 
 63  '''UNIT_OPTIONS''' 
 64   
 65  UNIT_SCALE_NORMAL = 1.0 
 66  UNIT_SCALE_SELECTED = 1.2 
 67   
 68  TIMER_SCALE = 0.3 
 69   
 70  UNIT_STARTING_OPACITY = 100 
 71   
 72  DECRYPT_DURATION = 3 
 73   
 74   
 75  '''MAP_OPTIONS''' 
 76  MAP_SCROLL_SPEED = 512 
 77  MAP_MOUSE_SCROLL_SPEED = 512 
 78  SLOT_RADIUS = 55.4 
 79   
 80  TIMER_X_OFFSET = 15 
 81  TIMER_Y_OFFSET = 15 
 82   
 83  ACTIONMENU_X_OFFSET = 90 
 84  ACTIONMENU_Y_OFFSET = 5 
 85   
 86  NUM_OF_SLOTS = 4 
 87  ANGLE_MULTIPLIER = 4.9 
 88   
 89  HALF_VISIBLE = 0.6  # opacity of 0.6 is half visible 
 90   
 91  AS_OPACITY = 1  # maximum AS opacity 
 92  AS_SCALE = 0.4 
 93  AS_EDGE_WIDTH = 6 
 94   
 95  TROOP_SLOT_SCALE = 0.7 
 96   
 97  MINIMAPCIRCLE_OPACITY = 200 
 98   
 99  HIGHLIGHTED_VERTEX_COLOR = (220,120,220) 
100  VERTEX_COLOR = (255,255,255) 
101   
102  '''TIMING_OPTIONS''' 
103  UNIT_SLOT_TO_VERTEX_SPEED = 0.1  # num of seconds it takes for a unit to move from a slot to a vertex 
104  LEVEL1 = 10  # time research takes at LEVEL<n> 
105  LEVEL2 = 20 
106  LEVEL3 = 30 
107  LEVEL4 = 40 
108   
109  '''Z-INDEX''' 
110  TIMER_Z = 11 
111  PACKET_Z = 2 
112  BUILDING_Z = 8 
113  TROOP_Z = 7 
114  SLOT_Z = 3 
115  VERTEX_Z = 3 
116  EDGE_Z = 1 
117  AS_CIRCLE_Z = 0 
118  BACKGROUND_Z = -1 
119  MINMAP_CIRCLE_Z = 11 
120  RSA_Z = 8 
121  MENU_BUTTON_Z = 10 
122  ACTION_MENU_Z = 9 
123   
124   
125  '''TEST_OPTIONS''' 
126  CELL_SIZE = 124  # will change to reflect diameter of vertex sprite (or slightly larger...) 
127  BUILD_OFFSET_X = 35 
128  BUILD_OFFSET_Y = 50 
129  # for testing, center of a unit relative to the bottom left of the unit 
130  UNIT_SIZE = 5 
131   
132  TEST_SPEEDUP = 4.0  # time multiplier for testing purposes 
133   
134  BUTTON_DICTIONARY = { 
135      'TAPTGet' : 'apt-get_action_button.png', 
136      'TInstaller' : 'installer_action_button.png', 
137      "TPing": "ping_action_button.png", 
138      "TDOS":"dos_action_button.png", 
139      "TSQL":"sql_action_button.png", 
140      "TDNSPoison":"dns_action_button.png", 
141      "TBufferOverflow":"bufferflow_action_button.png", 
142      "TSQLInjection":"sql_action_button.png", 
143      "THandshake":"hand_shake_action_button.png", 
144      "TSpoof":"spoof_action_button.png", 
145       
146      "BDB":"database_action_button.png", 
147      "BCPU":"cpu_action_button.png", 
148      "BRSA":"rsa_action_button.png", 
149      "BFirewall":"firewall_action_button.png", 
150      "BAlgorithmFactory":"algorithm_factory_action_button.png", 
151      "BSoftwareUpdater":"research_factory_action_button.png", 
152      "BDatabase":"database_action_button.png", 
153      "BHandshake":"hand_shake_action_button.png", 
154      "BSpoofedBuilding":"spoofed_building_action_button.png", 
155      "BSpoof":"spoofed_building_action_menu.png", 
156   
157      "UPingOfDeath":"ping_of_death_action_button.png", 
158      "UNMap":"nmap_action_button.png", 
159      "USinkhole":"sinkhole_action_button.png", 
160   
161      "RPortScanner":"port_research_action_button.png", 
162      "RHandshake":"hand_shake_research_action_button.png", 
163      "RBigData":"database_research_action_button.png", 
164      "RAdvancedAlgorithms":"advanced_research_factory.png", 
165      "RPingResearch": "ping_research_action_button.png", 
166      "RNetworkTopology": "sinkhole_research_action_button.png", 
167      "RFPGA":"cpu_research_action_button.png", 
168      "RRSA":"rsa_research_action_button.png", 
169      "ROverflow":"pod_research_action_button.png", 
170   
171      "DSpoof":"spoof_label.png", 
172       
173      "Shake":"shake_action_button.png", 
174      "Encrypt":"encrypt_action_button.png", 
175      "Decrypt":"dencrypt_action_button.png", 
176      "NMap":"perform_nmap_action_button.png", 
177      "Ping":"execute_ping_action_button.png", 
178       
179      "Attack":"attack_action_button.png", 
180  } 
181