Esempio n. 1
0
  def __init__(self, data, TemplateManager, InputManager):

    # DEVELOPMENT VERSION
    self.version  = "DEV 1.0"
    # INPUT COLLECTOR
    self.sysinput = InputManager()
    # TEMPLATE BUILDER
    self.template = TemplateManager()
    # FULL DATABASE
    self.database = deepcopy(data)
    # CURRENT TIME
    self.datetime = datetime.today().strftime("%d-%m-%Y")

    self.calculate()
Esempio n. 2
0
    def __init__(self):
        vsync = config.IS_VSYNC
        
        if config.IS_FULLSCREEN:
            self.__window = window.Window( fullscreen=True, vsync=vsync )
        else:
            width,height = config.WIN_SIZE
            self.__window = window.Window( width=width, height=height, fullscreen=False, vsync=vsync )

        self.__winSize = winSize = ( self.__window.width, self.__window.height )

        self.__camera = Camera( winSize )
        self.__hud    = HUD( winSize )

        self.__inputManager = InputManager()
        self.__window.on_key_press   = self.__inputManager.key_pressed
        self.__window.on_key_release = self.__inputManager.key_released

        if config.IS_FPS_LIMIT:
            clock.set_fps_limit( FPS_LIMIT )
        
        glDepthFunc( GL_LEQUAL )
        glEnable( GL_DEPTH_TEST )
        self.__world = GameWorld(self)        # to musi być na końcu
Esempio n. 3
0
        if state:
            print "\tdown is pushed"
        if not state:
            print "\tdown is released"

# SPACJA
        print
        state = subject.get_key_state("space")
        if state:
            print "\tspace is pushed"
        if not state:
            print "\tspace is released"


# Utworzenie InputManagera i włączenie go do pygleta
manager = InputManager()
window = Window()
window.on_key_press = manager.key_pressed
window.on_key_release = manager.key_released

# Tworzymy 3 obiekty obserwujące
ops1 = ConcreteInputObserver('ops1')
ops2 = ConcreteInputObserver('ops2')
ops3 = ConcreteInputObserver('ops3')

# dodajemy obserwatorów
manager.register_observer(ops1)
manager.register_observer(ops2)
manager.register_observer(ops3)

# usuwamy obserwatorów
Esempio n. 4
0
 def setupControle(self,):
     #Créer le contrôle
     #A besoin de la liste de tank pour relayer correctement le contrôle
     self.inputManager = InputManager(self.map.listTank,self.debugNP,self.pandaBase)
     self.accept("initCam",self.setupTransformCamera)