コード例 #1
0
ファイル: world.py プロジェクト: diegor2/FGAme
    def __init__(self, background=None,
                 gravity=None, damping=0, adamping=0,
                 restitution=1, friction=0,
                 bounds=None, max_speed=None,
                 simulation=None, force_init=True):

        if force_init:
            conf.init()
            conf.show_screen()
        self.background = background
        self._render_tree = RenderTree()
        self._input = conf.get_input()

        if simulation:
            self._simulation = simulation
        else:
            self._simulation = Simulation(
                gravity=gravity,
                damping=damping,
                adamping=adamping,
                restitution=restitution,
                friction=friction,
                max_speed=max_speed,
                bounds=bounds)

        self.is_paused = False
        super(World, self).__init__()

        # Inicia e popula o mundo
        self.init()
コード例 #2
0
ファイル: world.py プロジェクト: gutioliveira/FGAme
    def run(self, timeout=None, **kwds):
        """
        Runs simulation until the given timeout expires.

        Args:
            timeout (float):
                Maximum duration of simulation (in seconds). Leave None to
                run the simulation indefinitely.
        """

        conf.init()
        conf.show_screen()
        self._mainloop.run(self, timeout=timeout, **kwds)
コード例 #3
0
    def run(self, timeout=None, **kwds):
        """
        Runs simulation until the given timeout expires.

        Args:
            timeout (float):
                Maximum duration of simulation (in seconds). Leave None to
                run the simulation indefinitely.
        """

        conf.init()
        conf.show_screen()
        self._mainloop.run(self, timeout=timeout, **kwds)
コード例 #4
0
ファイル: orientation_objects.py プロジェクト: diegor2/FGAme
 def _globals(self):
     conf.init()
     self._globals = conf
     return self._globals
コード例 #5
0
 def _globals(self):
     conf.init()
     self._globals = conf
     return self._globals