Code Search for Developers
 
 
  

weapons.py from Thousand Parsec at Krugle


Show weapons.py syntax highlighted

class BasicLaser:
    width = 3
    duration = 500
    pulse = 1
    color = (0,0,255)
    surface = None

class Laser2 (BasicLaser):
    width = 3
    duration = 800
    pulse = 1
    color = (128,0,255)
    
class Laser5 (BasicLaser):
    width = 5
    duration = 900
    pulse = 1
    color = (255,128,0)
    
def make_weapon (label=None):
    weapon = None
    if label:
        # Create the right kind of weapon, should probably be turned into a LUT somewhere
        if label == 'laser5':
            weapon = Laser5()
        elif label == 'laser2':
            weapon = Laser2()
        else:
            weapon = BasicLaser()
    return weapon




See more files for this project here

Thousand Parsec

Thousand Parsec is a framework for turn based 4 X\'s game (eXplore, eXpand, eXploit, eXterminate). Designed for long games, supporting massive universes and has an easily expanded tech tree.

Project homepage: http://sourceforge.net/projects/thousandparsec
Programming language(s): C++,Python
License: other

  doc/
    relationship overview.dia
    relationship overview.png
  entities/
    __init__.py
    basicentity.py
    damageanimation.py
    laserblast.py
    message.py
    summaryscreen.py
  fonts/
    VeraMoBd.ttf
  minisec/
    battleship/
      model.png
    frigate/
      model.png
    planet/
      model.png
    scout/
      model.png
    types.xml
  tests/
    background.png
    battle1.xml
    battle2.xml
    battle3.xml
    battle4.xml
    battle5.xml
    battle6.xml
    damage_test.py
    laser_test.py
    ocemp_event_test.py
  BATTLEFORMAT
  README
  TODO
  WISHLIST
  actions.py
  battle.dtd
  battlecontroller.py
  battleparser.py
  battleview.py
  battleviewer.tailor
  constants.py
  example1.xml
  requirements.py
  run_battleviewer.py
  states.py
  utility.py
  weapons.py