Пример #1
0
        for airship in vessels:
            if i==0:
                airship.carry_out_order()

            airship.update(1./FRAMES_PER_SECOND, world_map.get_wind_vector())

            # let's move the ship
            #airship.move(1./FRAMES_PER_SECOND, world_map.get_wind_vector())
            # ...and turn it
            #airship.turn(1./FRAMES_PER_SECOND)

            # add some markers each second, to show the ships movement


            # check if we need to scroll the background
            ship_screen_pos = world_map.get_screen_coords(airship.position)
            #print "ship_screen_pos:", ship_screen_pos
            d = 0.3
            if ship_screen_pos.x > SWIDTH - SWIDTH*d:
                #print "X+"
                world_map.position.x += ship_screen_pos.x - (SWIDTH - SWIDTH*d)
            if ship_screen_pos.x < SWIDTH * d:
                #print "X-"
                world_map.position.x += ship_screen_pos.x - SWIDTH * d
            if ship_screen_pos.y > SHEIGHT - SHEIGHT * d:
                #print "Y+"
                world_map.position.y += ship_screen_pos.y - (SHEIGHT - SHEIGHT * d)
            if ship_screen_pos.y < SHEIGHT * d:
                #print "Y-"
                world_map.position.y += ship_screen_pos.y - SHEIGHT * d