Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Apple(adv.BaseEntity):
- def __init__(self, x=10, y=10, w=10, h=10):
- super().__init__(x, y, w, h, adv.EntData("Apple"))
- print(self.x)
- def draw(self):
- glBegin(GL_QUADS)
- glColor3f(255, 255, 255)
- glVertex2f(self.x, self.y)
- glVertex2f(self.x + self.w, self.y)
- glVertex2f(self.x + self.w, self.y + self.h)
- glVertex2f(self.x, self.y + self.h)
- glEnd()
- def randomise(self, winw, winh):
- self.x = random.randint(0, winw)
- self.y = random.randint(0, winh)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement