Galcon 3: the third -- join the party
 
 

Classic :: Wiki :: Mods_API

Home | Download | Buy | Forum | Net Ranks | Support


Home: Index
Page Up: Mods

The Galcon API

globals

- pygame key's: http://www.pygame.org/docs/ref/key.html 
- pygame events types: http://www.pygame.org/docs/ref/event.html 
- SW, SH - screen size (640x480 - all your drawing is done on a virtual screen of this size, even if you use a higher res mode)
- FPS - frames per second (32)
- BORDER, PADDING - just some suggested padding sizes for the level screen
- COLORS - a list of the default player colors

functions

All of these functions are available via the galcon. namespace:
particle systems
parts_init()
parts_loop() - call in your State.loop
parts_add(image,pos,radius,total)
parts_paint(screen) - call in your State.paint
      
file system
All the file system functions create files in the data folder.  The files must be no larger than 64k and there can be no more than 256 files in the data folder.

file_save(fname,data)
data = file_load(fname)
file_check_name(fname) - check if you have a valid file name.  File names may only contain lowercase letters, numbers, ., _.
file_check_exists(fname) - check if a file exists (to avoid having your mod crash if you load a missing file)
interaction
pos = mouse_get_pos()
mods = key_get_mods()
c = key_get_char(e.unicode)
debugging
print - will write output to the main Galcon screen
misc
mixer_reset() - reset the mixer (silence everything)

objects
-Font
-Surface
    scale((w,h)) - return a scaled Surface
-Sound
    Sound(fname) - return a Sound object.  Can load either .wav or .ogg files
    .play(loops=1) - play the sound. 
    .set_volume(value) - set the volume, value between 0.0 and 1.0.
-Music
    Music(fname) - return a Music object.  Can load either .wav or .ogg files
    .play(loops=1) - play the sound.  play(-1) will loop forever .
    .set_volume(value) - set the volume, value between 0.0 and 1.0.
-Image
-Bkgr
-Rect
    http://www.pygame.org/docs/ref/rect.html 
-State
-Level
    planets - the list of all planets in the game
    users - the list of all users in the game (neutral, player, and bots)
    game - 
    fleets - the list of all fleets for all players
    options - reference to the Options object
-User (base class for Bot, Player & Neutral)
    n - unique ID of the bot
    name - name of the bot
    color - color of user
    team - team the user belongs to
-Bot
-Player
    from_ - items selected "from"
    hover - item being hovered over
-Team
    name - name of the team
    color - team color, used to draw a "halo" around planets to show team ownership (this is optional)
-Planet
    n - unique ID of planet
    pos - position of planet ex: (x,y)
    user - reference to the player/bot/neutral object who owns this planet
    ships - number of ships on the planet
    production - production value
    name - descriptive name
    r - radius
    rect - the Rect bounding box
-Fleet
    user - reference to the player/bot/neutral object who owns this fleet
    from_ - planet this fleet originated from 
    to - planet this fleet is heading to
    ships - number of ships in this fleet
    color - a color (I think this may just be an override?)
    speed - speed of fleet's flight (value is a multiplayer, a speed of "2" makes the fleet twice as fast as the standard speed)
    get_rect() - returns the rect bounding box of the fleet