当前位置: 首页>>代码示例>>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;未经允许,请勿转载。