Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. class Apple(adv.BaseEntity):
  2.     def __init__(self, x=10, y=10, w=10, h=10):
  3.         super().__init__(x, y, w, h, adv.EntData("Apple"))
  4.         print(self.x)
  5.     def draw(self):
  6.         glBegin(GL_QUADS)
  7.         glColor3f(255, 255, 255)
  8.         glVertex2f(self.x, self.y)
  9.         glVertex2f(self.x + self.w, self.y)
  10.         glVertex2f(self.x + self.w, self.y + self.h)
  11.         glVertex2f(self.x, self.y + self.h)
  12.         glEnd()
  13.     def randomise(self, winw, winh):
  14.         self.x = random.randint(0, winw)
  15.         self.y = random.randint(0, winh)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement