示例#1
0
def run():
    print('READ JSON')
    job = read_json()
    # print(job)

    # if job is not {} and None:
    print('BUILD')
    objects.construct(job)
    print('RENDER2')
    render.start(job)
示例#2
0
    def __init__(self, settings, gui):
        if isinstance(settings, Config.Config_World):
            self.settings = settings

        self.gui = gui

        if isinstance(settings.screen, Config.Config_Screen):
            render.start(self.settings.screen.x_pos,
                         self.settings.screen.y_pos,
                         self.settings.screen.x_size,
                         self.settings.screen.y_size, 1000)

        # creating city grid
        for b in range(2):
            self.x_location += 100
            self.y_location = 90

            for z in range(3):
                self.y_location -= 20
                # self.x_location += 20

                for i in range(2):
                    self.y_location -= 10
                    self.x_location -= 20
                    self.c = random.randint(0, 1)

                    for t in range(2):
                        self.c2 = random.randint(0, 1)
                        b_location = P3.P3(self.x_location, self.y_location, 0)
                        # print(b_location)
                        buildings.extend([
                            Building.Building(b_location, 10,
                                              random.randrange(20, 65), 10,
                                              (self.c, 0, self.c2))
                        ])
                        self.x_location += 10

        if isinstance(settings, Config.Config_World):
            flock = settings.flocks[0]
            if isinstance(flock, Config.Config_Flock):
                self.F1 = Flock.Flock(flock.count,
                                      World.make_force_field(buildings),
                                      flock.center, flock.radius)

        self.render = render.Render(self.F1)
        gui.set_tick_method(self.tick)
示例#3
0
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Copyright (C) 2012, 2015 Jonathan Dieter <*****@*****.**>
"""

import sys, os

abspath = os.path.dirname(os.path.abspath(__file__))
if abspath not in sys.path:
    sys.path.append(abspath)
os.chdir(abspath)

import render

mode = "debug"

if __name__.startswith('_mod_wsgi_'):
    print "Detected mod_wsgi; running in WSGI mode"
    mode = "wsgi"
else:
    print "Running in debug mode"

application = render.start(mode)
示例#4
0
def main():
    ga = setup()
    render.setup(ga)
    render.start()
def init():
    """ Initializes the rendering process. """
    return render.start(particles)