pygame.mixer.music.play(-1, 0.0) #title of game pygame.display.set_caption('VVVVVV') while True: gamesurf.fill(BLACK) g.DebugRender(gamesurf) if char.tokens != 0: env.RemoveEntity(trinket) #switches environments upon moving to left or right, NEEDS CHECKPOINT FIXING? #if char.rect.right<5: # env,env2=env2,env #if char.rect.left>env.area.right+5: # env,env2=env2,env env.update() env.draw(gamesurf) pygame.transform.scale(gamesurf, (backbuf.get_width(), backbuf.get_height()), backbuf) window.blit(backbuf, (0, 0)) pygame.display.update() ''' if char.breakaway > 0 and char.breakaway < 2: pygame.mixer.music.load('data//snd//bgm//05 - Path Complete.mp3') pygame.mixer.music.play(0, 0.0) ''' ## char.SetHitWall(False) ## char.SetHitFloor(False) ## print char.vx, char.vy if counter%10==0: portal, portal2 = portal2, portal
remove_ent = [] for entity in environ[4]: if entity.enttype == ENT_ENEMY: if entity.health <= 0: remove_ent.append(entity) if entity.enttype == ENT_CHAR_BULLET or entity.enttype == ENT_ENEMY_BULLET: if entity.lifetime <= 0: remove_ent.append(entity) if entity.enttype == ENT_TOKEN: if entity.token in char.tokens: remove_ent.append(entity) for entity in remove_ent: environ[4].RemoveEntity(entity) envi.update() envi.draw(gamesurf) #draw specific parts of screen i.e. THE CAMERA pygame.transform.scale(gamesurf, (backbuf.get_width(), backbuf.get_height()), backbuf) window.blit(backbuf, (0, 0)) pygame.display.update() ## char.SetHitWall(False) ## char.SetHitFloor(False) ## print char.vx, char.vy for ev in pygame.event.get(): if ev.type == QUIT: #print eval('env_%d_%d()' %(char.x_co,char.y_co))[1] pygame.mixer.music.stop() pygame.quit() sys.exit()
def new_env(self, dry=False): user_env = EnvFile.Load(self.id) new_env = Environment(tool.create(dry)) new_env.update(user_env.env, WORK_DIR=self.__dir) return new_env