Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1.        
  2.     def get_location(self):
  3.         flagged = []
  4.         for x in range(len(self.bullets)):
  5.             self.bullets[x].gravity(self.body)
  6.             #for j in range(len(self.bullets)):
  7.             #    if x!=j:
  8.             #        self.bullets[x].gravity(self.bullets[j])
  9.             dtime = time() - self.bullettimes[x]
  10.             self.bullets[x].on_move(dtime)
  11.             self.bullets[x].x, self.bullets[x].y = int(self.bullets[x].x), int(self.bullets[x].y)
  12.             self.bullettimes[x] = time()
  13.             if self.bullets[x].x < 0 or self.bullets[x].x > self.screenx or self.bullets[x].y < 0 or self.bullets[x].y > self.screeny:
  14.                 flagged.append(x)
  15.                
  16.         for x in flagged:
  17.                 self.bullets.pop(x)
  18.                 self.bullettimes.pop(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement