本文整理汇总了Python中Graphics.icosahedron方法的典型用法代码示例。如果您正苦于以下问题:Python Graphics.icosahedron方法的具体用法?Python Graphics.icosahedron怎么用?Python Graphics.icosahedron使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphics
的用法示例。
在下文中一共展示了Graphics.icosahedron方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUpPlayer
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import icosahedron [as 别名]
def setUpPlayer (self, pos, clrBase = None, clrTurret = None):
if self.side == 'player':
self.maze.addPlayer (self)
self.pos = pos
self.vel = 0
self.cooldownTimer = 0
self.viewTheta = math.pi / 8
self.base = Graphics.cube (clrBase)
self.base.transform (Matrix.scale (7.5, 7.5, 3.75))
self.base.translate (self.pos.x (), self.pos.y(), 10)
self.turretp1 = Graphics.icosahedron (clrTurret)
self.turretp1.transform (Matrix.scale (5, 5, 5))
self.turretp2 = Graphics.cube (clrTurret)
self.turretp2.transform (Matrix.scale (1, 7.5, 1))
self.turretp2.translate (0, 3.5, 0)
self.turret = self.turretp1.union (self.turretp2)
self.turret.translate (self.pos.x (), self.pos.y(), 0)
self.theta = 0
self.turretTheta = 0
self.changeAngle (math.pi / 4)
self.alive = True
示例2: setPositionVelocity
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import icosahedron [as 别名]
def setPositionVelocity (self, pos, vel):
self.pos = pos
self.vel = vel
self.bulletObject = Graphics.icosahedron ()
self.bulletObject.translate (pos.x (), pos.y (), 5)