Пример #1
0
 def drawWorld(self):
     """
     aggregation function to draw all the the bugs
     and sticks of the world
     """
     render.drawSticks(self.stick_man.getSticks())
     render.drawBugs(self.bug_man.getBugs())
Пример #2
0
def loop():
    """
    main loop of program execution
    """
    # debug
    global special_bug

    # first update the object locations
    settings.map_man.tick()
    settings.screen.fill( settings.black )
    #sb0_direction = special_bug.eyes[0].direction 
    #sb1_direction = special_bug.eyes[1].direction 

    distance, new_pnts, _ = settings.map_man.sightDistances(special_bug)

    # rotate vision
    #special_bug.eyes[0].direction += 0.01 
    #special_bug.eyes[0].direction %= (2 * math.pi)
    #special_bug.eyes[1].direction -= 0.01 
    #special_bug.eyes[1].direction %= (2 * math.pi)

    #special_bug.moveRandom()
    
    # debug: drawing collision points/debug bug
    render.drawPoints(new_pnts)

    # drawing bugs
    bugs = settings.map_man.bug_man.getBugs()
    render.drawBugs(bugs)
    # drawing sticks
    t_sticks = settings.map_man.stick_man.getSticks()
    render.drawSticks( t_sticks )
    # drawing fps display
    settings.screen.blit(settings.fps_surf, settings.fps_dest)

    pygame.display.update()