Пример #1
0
    #                      mousepos.tuple(), 3)

    #     pygame.display.flip()

    # airship.set_rotation( mouseangle )
    # airship.acceleration = max(-10, min(10, (mousedist-airship.speed)/20))
    # print airship.acceleration, airship.rotation

    #### And below is the "realtime" part

    for i in range(TURNTIME * FRAMES_PER_SECOND):
        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+"