示例#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
    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
 def _globals(self):
     conf.init()
     self._globals = conf
     return self._globals
 def _globals(self):
     conf.init()
     self._globals = conf
     return self._globals