本文整理汇总了Python中gameobject.GameObject.draw方法的典型用法代码示例。如果您正苦于以下问题:Python GameObject.draw方法的具体用法?Python GameObject.draw怎么用?Python GameObject.draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gameobject.GameObject
的用法示例。
在下文中一共展示了GameObject.draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw
# 需要导入模块: from gameobject import GameObject [as 别名]
# 或者: from gameobject.GameObject import draw [as 别名]
def draw(self):
if self.game.debug:
for i in range(len(self.body.fixtures)):
pt = self._place(i)
pygame.draw.circle(self.game.screen, (20, 20, 20), self.game.to_screen(pt),
int(10 * self.game.camera.zoom), 1)
pt = self._place(i, False)
pygame.draw.circle(self.game.screen, (20, 20, 20), self.game.to_screen(pt),
int(10 * self.game.camera.zoom), 1)
GameObject.draw(self)
示例2: draw
# 需要导入模块: from gameobject import GameObject [as 别名]
# 或者: from gameobject.GameObject import draw [as 别名]
def draw(self):
mouse_x, mouse_y = pygame.mouse.get_pos()
if point_direction(self.x, self.y, mouse_x + self.root.Xview, mouse_y + self.root.Yview) > 90 and point_direction(self.x, self.y, mouse_x + self.root.Xview, mouse_y + self.root.Yview) < 270:
if self.flip == 0:
self.sprite = pygame.transform.flip(self.sprite, 1, 0)
self.flip = 1
else:
if self.flip:
self.sprite = pygame.transform.flip(self.sprite, 1, 0)
self.flip = 0
GameObject.draw(self)
示例3: draw
# 需要导入模块: from gameobject import GameObject [as 别名]
# 或者: from gameobject.GameObject import draw [as 别名]
def draw(self):
GameObject.draw(self)