Return to repo list

gatemender

Arcade game about fixing warp gates. LibreJam Dec 2020 Entry.
Return to HMagellan.com

constants.py (4010B)


      1 import pygame, os, enum, json
      2 
      3 # Controls
      4 CONTROLS = {
      5     "TURN_LEFT_KEY" : pygame.K_a,
      6     "TURN_RIGHT_KEY" : pygame.K_d,
      7     "BRAKE_KEY" : pygame.K_s,
      8     "SHOOT_KEY" : pygame.K_SPACE,
      9     "THRUST_KEY" : pygame.K_w,
     10     "REPAIR_KEY" : pygame.K_e,
     11     "BURST_KEY" : pygame.K_k,
     12     "CONFIRM_KEY" : pygame.K_RETURN
     13 }
     14 # Example alternative config adapted from glw@linuxmail.org from here: https://leagueh.xyz/mail/hyperkitty/list/librejam@leagueh.xyz/message/64Y5OV2BSFRSTZTEORBDI4ZMEYDQ6346/
     15 #CONTROLS = {
     16 #    "TURN_LEFT_KEY" : pygame.K_LEFT,
     17 #    "TURN_RIGHT_KEY" : pygame.K_RIGHT,
     18 #    "BRAKE_KEY" : pygame.K_DOWN,
     19 #    "SHOOT_KEY" : pygame.K_SPACE,
     20 #    "THRUST_KEY" : pygame.K_UP,
     21 #    "REPAIR_KEY" : pygame.K_RETURN,
     22 #    "BURST_KEY" : pygame.K_k,
     23 #    "CONFIRM_KEY" : pygame.K_z
     24 #}
     25 
     26 # HIGHSCORE
     27 with open("hs.json") as j: HIGHSCORES = json.load(j)
     28 
     29 SCREEN_DIM = (1024, 768)
     30 FRAMERATE = 60
     31 COLORKEY = (255, 0, 255)
     32 SHIP_MAX_SPEED = 5
     33 BULLET_SPEED = 12
     34 DEGREE_CORRECTION = 90
     35 IMAGE_FILES = {
     36     "Title" : os.path.join("data", "title.png"),
     37     "Ship": os.path.join("data", "ship1.png"),
     38     "Bullet" : os.path.join("data", "bullet1.png"),
     39     "Small_Asteroid" : os.path.join("data", "asteroid_small.png"),
     40     "Medium_Asteroid" : os.path.join("data", "asteroid_medium.png"),
     41     "Big_Asteroid" : os.path.join("data", "asteroid_big.png"),
     42     "Asteroid_Particle" : os.path.join("data", "asteroid_particle.png"),
     43     "Space_Background" : os.path.join("data", "space_background.png"),
     44     "Gate_Angle_Fixed" : os.path.join("data", "gate_angle_fixed.png"),
     45     "Gate_Angle_Broken" : os.path.join("data", "gate_angle_broken.png"),
     46     "Gate_Straight_Fixed" : os.path.join("data", "gate_straight_fixed.png"),
     47     "Gate_Straight_Broken" : os.path.join("data", "gate_straight_broken.png"),
     48     "Alpha_Halo_Straight" : os.path.join("data", "alpha_halo_straight.png"),
     49     "Alpha_Halo_Angle" : os.path.join("data", "alpha_halo_angle.png"),
     50     "Beta_Halo_Straight" : os.path.join("data", "beta_halo_straight.png"),
     51     "Beta_Halo_Angle" : os.path.join("data", "beta_halo_angle.png"),
     52     "Gamma_Halo_Straight" : os.path.join("data", "gamma_halo_straight.png"),
     53     "Gamma_Halo_Angle" : os.path.join("data", "gamma_halo_angle.png"),
     54     "Alpha_Icon" : os.path.join("data", "alpha_material.png"),
     55     "Beta_Icon" : os.path.join("data", "beta_material.png"),
     56     "Gamma_Icon" : os.path.join("data", "gamma_material.png"),
     57     "Big_Alpha_Icon" : os.path.join("data", "alpha_material_big.png"),
     58     "Big_Beta_Icon" : os.path.join("data", "beta_material_big.png"),
     59     "Big_Gamma_Icon" : os.path.join("data", "gamma_material_big.png"),
     60     "Repair_Pickup" : os.path.join("data", "repair_pickup.png"),
     61     "UI_Tray" : os.path.join("data", "hud_tray.png"),
     62     "Fix_Aura" : os.path.join("data", "fix_aura.png"),
     63     "Vortex" : os.path.join("data", "vortex.png"),
     64     "Info" : os.path.join("data", "info.png"),
     65     "Empty_Checkbox" : os.path.join("data", "empty_checkbox.png"),
     66     "Checked_Checkbox" : os.path.join("data", "checked_checkbox.png"),
     67     "Ship_Fire" : os.path.join("data", "fire.png")
     68 }
     69 SOUND_FILES = {
     70     "Main_Menu_Music" : os.path.join("data", "title_screen.ogg"),
     71     "Game_Music" : os.path.join("data", "level3.ogg"),
     72     "Shoot" : os.path.join("data", "shoot.ogg"),
     73     "Fix" : os.path.join("data", "fix.ogg"),
     74     "Explode" : os.path.join("data", "explode.ogg"),
     75     "Damage" : os.path.join("data", "damage.ogg"),
     76     "Chime" : os.path.join("data", "chime.ogg"),
     77     "Thrust" : os.path.join("data", "thrust.ogg"),
     78     "Appear" : os.path.join("data", "appear.ogg"),
     79     "Click" : os.path.join("data", "click.ogg"),
     80     "Pickup" : os.path.join("data", "pickup.ogg"),
     81     "Flash" : os.path.join("data", "flash.ogg"),
     82     "Repair" : os.path.join("data", "repair.ogg"),
     83     "Complete" : os.path.join("data", "complete.ogg")
     84 }
     85 FONTPATH = os.path.join("data", "computerspeak03.ttf")
     86 MATERIALS = enum.Enum("MATERIALS", "Alpha Beta Gamma")
     87 MODES = enum.Enum("MODES", "Menu Options Transition GameOver Play")