def __init__(self,x,y,surf,color,group,maxX,maxY,start_vec,tail,game): Sprite.__init__(self) if self.image == None: self.image = system.load_graphics(str('pnvscaled.png')) self.rect = self.image.get_rect() self.makeANew = False self.rect.x = x self.reset = x,y self.rect.y = y self.screen = surf self.maxX = maxX self.maxY = maxY self.group = group self.add(group) self.lives = 5 self.tailGroup = tail self.tailColorCounter = 0 self.tailColors = [(0,0,255),(0,114,54),(255,255,0),(237,28,36),(199,178,153),(158,0,93)] self.tail = Tails(self.tailGroup,self.tailColors[self.tailColorCounter]) self.addTail = True self.alive = True self.shrink = False self.shrinkw = self.rect.w self.shrinkh = self.rect.h self.shrinkx = self.rect.x self.shrinky = self.rect.y self.shrinkTime = True self.backup = self.image self.start_vec = start_vec self.vx,self.vy = start_vec self.vxi,self.vyi = start_vec self.ax = 0 self.ay = 0 self.game = game self.imageBackup = self.image
def __init__(self,x,y,group,surf,w,h,mass,image=str('black_hole.png')): Sprite.__init__(self) if self.image == None: self.image = system.load_graphics(image) self.image = self.scale(w,h) self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y self.group = group self.add(self.group) self.mass = mass self.surface = surf
def __init__(self,x,y,friends,place,image=str('taskbar.png')): Sprite.__init__(self) if self.image == None: self.image = system.load_graphics(image) self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y self.add(friends) self.group = friends self.screen = place self.nextPosition = 0 self.images = [(str('saturny.png')),(str('ring_planet.png')), (str('earth.png'))]
def __init__(self,x,y,group,mass=0): Sprite.__init__(self) if self.image == None: self.image = system.load_graphics('venus.png') self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y self.group = group self.mass = mass self.add(group) self.nextPosition = 0 self.positions = [(638,135),(687,355),(680,400)] self.images = [(str('saturny.png')),(str('ring_planet.png')), (str('earth.png'))]
def __init__(self,x,y,group,surf,size,kind): Sprite.__init__(self) image_choices = [(str("alien0.png")),(str("alien1.png")), (str("alien2.png")),(str("alien3.png")), (str('asteroid.png'))] if self.image == None: self.image = system.load_graphics(image_choices[kind]) self.kind = kind self.image = self.scale(size) self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y self.group = group self.add(self.group) self.surface = surf
def __init__(self,x,y,w,h,start_mass,group,temp,obstacles_grp,bar,player,kind,goal,image): Sprite.__init__(self) if self.image == None: self.image = system.load_graphics(image) self.image = pygame.transform.smoothscale(self.image,(w,h)) self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y self.mass = start_mass self.reGroup = False self.group = group self.grabbed = True self.mouse_offset = ((26,26)) self.temp = temp self.add(temp) self.bar = bar self.ob_grp = obstacles_grp self.og_place = ((x,y)) self.player = player self.kind = kind self.goal = goal
def light(self): locked = False self.image = system.load_graphics(self.img_txt[0])
def dark(self): locked = True self.image = system.load_graphics(self.img_txt[1])
def back_to_three(self,re_group): self.next_life = 5 self.image = system.load_graphics(self.life_image[self.next_life])
def reset(self): self.next_life = 5 self.image = system.load_graphics(self.life_image[self.next_life])
def update(self): self.next_life -= 1 self.image = system.load_graphics(self.life_image[self.next_life])
def change_image(self,new_image=str('earth.png')): self.image = system.load_graphics(new_image)
def next_level(self,level): x,y = self.positions[level-2] self.image = system.load_graphics(self.images[level-2]) self.rect.x = x self.rect.y = y self.nextPosition += 1