本文整理匯總了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)