def update(self, dt): if randrange(60) == 0: self.vx = -self.vx Ship.update(self, dt) if self.vx > 0: self.image = self.orig_image else: self.image = self.flipped_image
def update(self, dt): #one in 60 chance it will flip directions if randrange(60) == 0: self.vx = -self.vx Ship.update(self, dt) if self.vx > 0: self.image = self.orig_image else: self.image = self.flipped_image
def update(self, dt): vx = self.vx vy = self.vy Ship.update(self, dt) if vx != self.vx or vy != self.vy: if vx != self.vx: vx = self.vx vy = -vy else: vx = -vx vy = self.vy
def update(self, dt): vx = self.vx vy = self.vy Ship.update(self, dt) if vx != self.vx or vy != self.vy: if vx != self.vx: vx = self.vx vy = -vy else: vx = -vx vy = self.vy tie = TieFighter(self.rect.x, self.rect.y, vx, vy, self.bounds, self.color) for group in self.groups(): group.add(tie)
def update(self, dt): vx = self.vx vy = self.vy Ship.update(self, dt) # create a new ship if bounced (when they bounce, vx, vy no longer = self.vx or self.vy if vx != self.vx or vy != self.vy: if vx != self.vx: vx = self.vx vy = -vy else: vx = -vx vy = self.vy tie = TieFighter(self.rect.x, self.rect.y, vx, vy, self.bounds, self.color) for group in self.groups(): group.add(tie)
def update(self, dt): #if randrange(60) == 0: # self.vx = -self.vx Ship.update(self, dt)
def update(self, dt): vx = self.vx vy = self.vy Ship.update(self, dt)