Exemple #1
0
    def act(self):
        
        self.timer.tick(60)
        surface_manager.clear(self.display, self.background)
        
        keys = pygame.key.get_pressed()
        if keys[K_RIGHT]:
            self.player.mover_der()
        
        if keys[K_LEFT]:
            self.player.mover_izq()
        
        if keys[K_UP]:
            self.player.jump()
        else:
            self.player.stop_jumping()
        
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                if event.key == K_1:
                    self.player.throw_shuriken()
        
 
        self.level_manager.update()
        surface_manager.update()
        dirty_rects = surface_manager.draw(self.display)
        pygame.display.update(dirty_rects)
        
        if self.p_vez1:
            self.instruc.play()
            pygame.time.delay(int(self.instruc.get_length()*1000))
            self.p_vez1 = False
Exemple #2
0
    def act(self):
        self.timer.tick(60)
        surface_manager.clear(self.display, self.background)

        keys = pygame.key.get_pressed()
        if keys[K_SPACE]:
            self.player.jump()
        else:
            self.player.stop_jumping()

        for event in pygame.event.get():
            if event.type == KEYDOWN:
                if event.key == K_1:
                    self.player.throw_shuriken()

        check_for_combo()
        self.level_manager.update()
        surface_manager.update()
        dirty_rects = surface_manager.draw(self.display)
        pygame.display.update(dirty_rects)
Exemple #3
0
    def act(self):
        self.timer.tick(60)
        surface_manager.clear(self.display, self.background)

        keys = pygame.key.get_pressed()
        if keys[K_SPACE]:
            self.player.jump()
        else:
            self.player.stop_jumping()
        
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                if event.key == K_1:
                    self.player.throw_shuriken()
        
        check_for_combo()
        self.level_manager.update()
        surface_manager.update()
        dirty_rects = surface_manager.draw(self.display)
        pygame.display.update(dirty_rects)
Exemple #4
0
    def act(self):
        self.timer.tick(60)
        surface_manager.clear(self.display, self.background)
        #Sets up the key-press functions
        keys = pygame.key.get_pressed()
        #Jump
        if keys[K_SPACE]:
            self.player.jump()
        else:
            self.player.stop_jumping()
        #Shoot
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                if event.key == K_f:
                    self.player.shoot()

        check_for_combo()
        self.level_manager.update()
        surface_manager.update()
        dirty_rects = surface_manager.draw(self.display)
        pygame.display.update(dirty_rects)