当前位置: 首页>>代码示例>>Python>>正文


Python Location.y方法代码示例

本文整理汇总了Python中bravo.location.Location.y方法的典型用法代码示例。如果您正苦于以下问题:Python Location.y方法的具体用法?Python Location.y怎么用?Python Location.y使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bravo.location.Location的用法示例。


在下文中一共展示了Location.y方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _load_entity_from_tag

# 需要导入模块: from bravo.location import Location [as 别名]
# 或者: from bravo.location.Location import y [as 别名]
    def _load_entity_from_tag(self, tag):
        location = Location()

        position = tag["Pos"].tags
        rotation = tag["Rotation"].tags
        location.x = position[0].value
        location.y = position[1].value
        location.z = position[2].value
        location.yaw = rotation[0].value
        location.pitch = rotation[1].value
        location.grounded = bool(tag["OnGround"])

        entity = entities[tag["id"].value](location=location)

        self._entity_loaders[entity.name](entity, tag)

        return entity
开发者ID:mmcgill,项目名称:bravo,代码行数:19,代码来源:beta.py

示例2: create_entity

# 需要导入模块: from bravo.location import Location [as 别名]
# 或者: from bravo.location.Location import y [as 别名]
    def create_entity(self, x, y, z, name, **kwargs):
        """
        Spawn an entirely new entity.

        Handles entity registration as well as instantiation.
        """

        location = Location()
        location.x = x
        location.y = y
        location.z = z
        entity = entities[name](eid=0, location=location, **kwargs)

        self.register_entity(entity)

        bigx = entity.location.x // 16
        bigz = entity.location.z // 16

        d = self.world.request_chunk(bigx, bigz)
        d.addCallback(lambda chunk: chunk.entities.add(entity))
        d.addCallback(lambda none: log.msg("Created entity %s" % entity))

        return entity
开发者ID:gr8firedragon,项目名称:bravo,代码行数:25,代码来源:beta.py

示例3: create_entity

# 需要导入模块: from bravo.location import Location [as 别名]
# 或者: from bravo.location.Location import y [as 别名]
    def create_entity(self, x, y, z, name, **kwargs):
        """
        Spawn an entirely new entity.

        Handles entity registration as well as instantiation.
        """

        location = Location()
        location.x = x
        location.y = y
        location.z = z
        entity = entities[name](eid=0, location=location, **kwargs)

        self.register_entity(entity)

        bigx = entity.location.x // 16
        bigz = entity.location.z // 16

        d = self.world.request_chunk(bigx, bigz)
        d.addCallback(lambda chunk: chunk.entities.add(entity))
        d.addCallback(lambda none: log.msg("Created entity %s" % entity))
        if hasattr(entity,'loop'): # XXX Maybe just send the entity object to the manager?
            self.world.mob_manager.start_mob(entity)
        return entity
开发者ID:squiddy,项目名称:bravo,代码行数:26,代码来源:factory.py

示例4: test_distance

# 需要导入模块: from bravo.location import Location [as 别名]
# 或者: from bravo.location.Location import y [as 别名]
 def test_distance(self):
     other = Location()
     other.x = 2
     other.y = 3
     other.z = 6
     self.assertEqual(self.l.distance(other), 7)
开发者ID:squiddy,项目名称:bravo,代码行数:8,代码来源:test_location.py


注:本文中的bravo.location.Location.y方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。