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


Python Physics.physics方法代码示例

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


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

示例1: __init__

# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import physics [as 别名]
 def __init__(self, size, cam, tilePics,itemList,tileCracks,weaponPics,armorPics,over, unit=32, lighting = True,special=True):
     self.size = size
     self.unit = unit
     self.rows = self.size[1] // self.unit
     self.columns = self.size[0] // self.unit
     self.cam = cam
     self.tilePics = tilePics
     self.startLighting = False
     self.itemList = itemList
     self.special = special
     self.entities = []
     self.physics = Physics.physics(self)
     self.AIOn = True
     self.tileCracks = tileCracks
     self.weaponPics = weaponPics
     self.spawners = []
     self.charList = CharacterList.characterList(armorPics)
     self.over = over
     self.armorPics = armorPics
     self.towns = []
     self.tileList = TileList.tileList()
     if lighting == True:
         self.lighting = Lighting.lighting(self)
         self.baseLightLevel = 255
     else:
         self.lighting = False
     self.resetTiles()
     self.resetMetadata()
     '''if lighting == True:
开发者ID:adambenn,项目名称:Game2,代码行数:31,代码来源:World.py

示例2: loadPictures

# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import physics [as 别名]
    screenSize,
    mainCamera,
    loadPictures("data/images/tiles/"),
    itemList,
    tileCracks,
    weaponPics,
    armorPics,
    None,
    32,
    False,
    special=False,
)  # creates a mini world for the menu
backFill = random.randint(0, len(menBack.tilePics) - 1)  # chooses a random num from 0,1

menBack.fill(backFill)  # fill with the block
physics = Physics.physics(menBack)


def toggle(mainVar):
    var = mainVar
    if var == True:
        var = False
    elif var == False:
        var = True
    return var


men = mainMenu(screen)  # creates a menu
titleFont = pygame.font.Font(pygame.font.match_font("impact"), 55)  # creates a tile font
titleFont.set_underline(True)  # underlines the title
title = men.newTitle(titleFont, "Game 2", (screenSize[0] // 2, (screenSize[1] // 2) - 100))  # creates a title
开发者ID:adambenn,项目名称:Game2,代码行数:33,代码来源:Main.py


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