當前位置: 首頁>>代碼示例>>Python>>正文


Python pymunk.inf方法代碼示例

本文整理匯總了Python中pymunk.inf方法的典型用法代碼示例。如果您正苦於以下問題:Python pymunk.inf方法的具體用法?Python pymunk.inf怎麽用?Python pymunk.inf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pymunk的用法示例。


在下文中一共展示了pymunk.inf方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_obstacle

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def create_obstacle(self, x, y, r):
        c_body = pymunk.Body(pymunk.inf, pymunk.inf)
        c_shape = pymunk.Circle(c_body, r)
        c_shape.elasticity = 1.0
        c_body.position = x, y
        c_shape.color = THECOLORS["blue"]
        self.space.add(c_body, c_shape)
        return c_body 
開發者ID:llSourcell,項目名稱:Self-Driving-Car-Demo,代碼行數:10,代碼來源:carmunk.py

示例2: accelerate

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def accelerate(self, direction):
        amt = direction * self.move_power
        self.motor.max_force = pymunk.inf
        self.motor.rate = amt 
開發者ID:pygame,項目名稱:stuntcat,代碼行數:6,代碼來源:model.py

示例3: make_body

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def make_body(rect, moment=pymunk.inf):
    if moment is None:
        body = pymunk.Body()
    else:
        body = pymunk.Body(1, moment)
    shape = make_hitbox(body, rect)
    return body, shape 
開發者ID:pygame,項目名稱:stuntcat,代碼行數:9,代碼來源:unicyclecat.py

示例4: create_obstacle

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def create_obstacle(self, xy1, xy2, r, color):
        c_body = pymunk.Body(pymunk.inf, pymunk.inf)
        #c_shape = pymunk.Circle(c_body, r)
        c_shape = pymunk.Segment(c_body, xy1, xy2, r)
        #c_shape.elasticity = 1.0
        #c_body.position = x, y
        c_shape.friction = 1.
        c_shape.group = 1
        c_shape.collision_type = 1
        c_shape.color = THECOLORS[color]
        self.space.add(c_body, c_shape)
        return c_body 
開發者ID:jangirrishabh,項目名稱:toyCarIRL,代碼行數:14,代碼來源:carmunk.py

示例5: add_wall

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def add_wall(self, pt_from, pt_to):
        body = pymunk.Body(body_type=pymunk.Body.STATIC)
        ground_shape = pymunk.Segment(body, pt_from, pt_to, 0.0)
        ground_shape.friction = 0.8
        ground_shape.elasticity = .99
        ground_shape.mass = pymunk.inf
        self.space.add(ground_shape) 
開發者ID:PySimpleGUI,項目名稱:PySimpleGUI,代碼行數:9,代碼來源:Demo_Graph_Ball_Game.py

示例6: static_ball

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def static_ball(p, radius):
    """Creates a ball that remains fixed in place.

    :param p: The center point of the ball
    :type p: (int, int)
    :param radius: The radius of the ball
    :type radius: int
    :rtype: shape

    """
    return _ball(p, radius, pymunk.inf, True) 
開發者ID:jshaffstall,項目名稱:PyPhysicsSandbox,代碼行數:13,代碼來源:__init__.py

示例7: static_box

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def static_box(p, width, height):
    """Creates a box that remains fixed in place.

    :param p: The upper left corner of the box
    :type p: (int, int)
    :param width: The width of the box
    :type width: int
    :param height: The height of the box
    :type height: int
    :rtype: shape

    """
    return _box(p, width, height, pymunk.inf, True) 
開發者ID:jshaffstall,項目名稱:PyPhysicsSandbox,代碼行數:15,代碼來源:__init__.py

示例8: static_rounded_box

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def static_rounded_box(p, width, height, radius):
    """Creates a box with rounded corners that remains fixed in place.

    :param p: The upper left corner of the box
    :type p: (int, int)
    :param width: The width of the box
    :type width: int
    :param height: The height of the box
    :type height: int
    :param radius: The radius of the rounded corners
    :type radius: int
    :rtype: shape

    """
    return _box(p, width, height, pymunk.inf, True, radius) 
開發者ID:jshaffstall,項目名稱:PyPhysicsSandbox,代碼行數:17,代碼來源:__init__.py

示例9: static_polygon

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def static_polygon(vertices):
    """Creates a polygon that remains fixed in place.

    :param vertices: A tuple of points on the polygon
    :type vertices: ((int, int), (int, int), ...)
    :rtype: shape

    """
    return _polygon(vertices, pymunk.inf, True) 
開發者ID:jshaffstall,項目名稱:PyPhysicsSandbox,代碼行數:11,代碼來源:__init__.py

示例10: static_triangle

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def static_triangle(p1, p2, p3):
    """Creates a triangle that remains fixed in place.

    :param p1: The first point of the triangle
    :type p1: (int, int)
    :param p2: The second point of the triangle
    :type p2: (int, int)
    :param p3: The third point of the triangle
    :type p3: (int, int)
    :rtype: shape

    """
    return _triangle(p1, p2, p3, pymunk.inf, True) 
開發者ID:jshaffstall,項目名稱:PyPhysicsSandbox,代碼行數:15,代碼來源:__init__.py

示例11: static_text_with_font

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def static_text_with_font(p, caption, font, size):
    """Creates a text rectangle that remains fixed in place.

    :param p: The upper left corner of the text rectangle
    :type p: (int, int)
    :param caption: The text to display
    :type caption: string
    :param font: The font family to use
    :type font: string
    :param size: The point size of the font
    :type size: int
    :rtype: shape

    """
    return _text_with_font(p, caption, font, size, pymunk.inf, True) 
開發者ID:jshaffstall,項目名稱:PyPhysicsSandbox,代碼行數:17,代碼來源:__init__.py

示例12: static_line

# 需要導入模塊: import pymunk [as 別名]
# 或者: from pymunk import inf [as 別名]
def static_line(p1, p2, thickness):
    """Creates a line segment that remains fixed in place.

    :param p1: The starting point of the line segement
    :type p1: (int, int)
    :param p2: The ending point of the line segement
    :type p2: (int, int)
    :param thickness: The thickness of the line segement
    :type thickness: int
    :rtype: shape

    """
    return _line(p1, p2, thickness, pymunk.inf, True) 
開發者ID:jshaffstall,項目名稱:PyPhysicsSandbox,代碼行數:15,代碼來源:__init__.py


注:本文中的pymunk.inf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。