Пример #1
0
    def update(self, dt):
        State.update(self, dt)

        self.lastJump += dt
        if self.lastJump > 2:
            self.point = Vector.random([PIXEL_DIM_X-1, PIXEL_DIM_Y-1])
            self.lastJump = 0

        if self.explosion:
            self.explosion.update(dt)

        for character in self.characters:
            character.update(dt)

            if character.position.toInt() == self.point.toInt():
                character.score += 1
                character.animation.duration = 1.0/character.score 

                self.point = Vector.random([PIXEL_DIM_X-1, PIXEL_DIM_Y-1])

                if character.score > 5:
                    character.score = 0
                    character.animation.duration = 1.0

                    self.explosion = Explosion(character.position)
Пример #2
0
    def update(self, dt):
        State.update(self, dt)

        if time.time() > self.started + 3000:
            self.ended = True
        else:
            self.sprite.update(dt)
Пример #3
0
    def update(self, dt):
        State.update(self, dt)

        self.lastJump += dt
        if self.lastJump > 2:
            self.point = Vector.random([PIXEL_DIM_X - 1, PIXEL_DIM_Y - 1])
            self.lastJump = 0

        if self.explosion:
            self.explosion.update(dt)

        for character in self.characters:
            character.update(dt)

            if character.position.toInt() == self.point.toInt():
                character.score += 1
                character.animation.duration = 1.0 / character.score

                self.point = Vector.random([PIXEL_DIM_X - 1, PIXEL_DIM_Y - 1])

                if character.score > 5:
                    character.score = 0
                    character.animation.duration = 1.0

                    self.explosion = Explosion(character.position)
Пример #4
0
    def update(self, dt):
        State.update(self, dt)

        if time.time() > self.started + 3000:
            self.ended = True
        else:
            self.sprite.update(dt)
Пример #5
0
    def update(self, dt):
        State.update(self, dt)

        self.offset += self.scroll_speed * dt
        self.scroll_speed += self.scroll_speed_increment * dt

        if self.offset >= 1.0:
            while self.offset >= 1.0:
                self.offset -= 1.0

            self.check_collision()

            del self.map[0]
            self.map.append(self.generate_map_slice())

        self.ship.update(dt)
        self.ship.animation.duration = 1.0 / self.scroll_speed

        self.sprites = [sprite for sprite in self.sprites if not sprite.ended]
        for sprite in self.sprites:
            sprite.update(dt)
Пример #6
0
    def update(self, dt):
        State.update(self, dt)

        self.offset += self.scroll_speed * dt
        self.scroll_speed += self.scroll_speed_increment * dt

        if self.offset >= 1.0:
            while self.offset >= 1.0:
                self.offset -= 1.0

            self.check_collision()

            del self.map[0]
            self.map.append(self.generate_map_slice())

        self.ship.update(dt)
        self.ship.animation.duration = 1.0/self.scroll_speed

        self.sprites = [sprite for sprite in self.sprites if not sprite.ended]
        for sprite in self.sprites:
            sprite.update(dt)
Пример #7
0
    def update(self, dt):
        State.update(self, dt)

        for character in self.characters:
            character.update(dt)
Пример #8
0
    def update(self, dt):
        State.update(self, dt)

        for character in self.characters:
            character.update(dt)