overactive

ghc

Aug 1st, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. class Drop():
  2.     def __init__(self, x, y, speed):
  3.         self.x = x
  4.         self.y = y
  5.         self.speed = speed
  6.  
  7.     def randomize(self):
  8.         self.x = random.randint(0, WIDTH-2)
  9.         self.y = random.randint(-700, -10)
  10.         self.speed = random.randint(1, 2)
  11.         return self.x, self.y, self.speed
  12.        
  13.     def update(self):
  14.         self.y += self.speed
  15.         self.dropRect = (self.x, self.y, 1, 20)
  16.  
  17.     def show(self):
  18.         pygame.draw.rect(canvas, BLUE, self.dropRect, 1)
Advertisement
Add Comment
Please, Sign In to add comment