from pygame import Surface

from lib.pgfw.pgfw.Sprite import Sprite

class Spikes(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_configuration()
        self.set_frames()
        self.register(self.slide)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("spikes")
        self.delay = config["delay"]
        self.speed = config["speed"]

    def set_frames(self):
        surface = Surface((32, 8))
        surface.fill((0, 255, 0))
        self.add_frame(surface, omit=True)
        self.add_frameset(0, name="sliding")
        blank = Surface(self.location.size)
        blank.set_colorkey((0, 0, 0))
        self.add_frame(blank, omit=True)
        self.add_frameset([0, 1], self.parent.blink_rate, "queued")

    def reset(self):
        self.set_frameset("queued")
        self.halt(self.slide)
        self.active = False
        self.queue_reset = False
        self.location.center = self.display_surface.get_rect().right, \
                               self.parent.parent.platforms[0].location.top

    def queue_slide(self):
        self.active = True
        self.play(self.slide, delay=self.delay)

    def slide(self):
        self.set_frameset("sliding")
        self.move(-self.speed)
        if self.location.right <= self.display_surface.get_rect().left:
            self.queue_reset = True
        if self.location.colliderect(self.parent.parent.food):
            self.parent.parent.food.freeze()

    def update(self):
        if self.active:
            Sprite.update(self)
        if self.queue_reset:
            self.reset()
from random import randrange

from pygame import Surface

from lib.pgfw.pgfw.Sprite import Sprite

class Fireball(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_configuration()
        self.set_frames()
        self.register(self.spew)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("fireball")
        self.delay = config["delay"]
        self.speed = config["speed"]
        self.peak = config["peak"]

    def set_frames(self):
        surface = Surface((24, 8))
        surface.fill((0, 255, 255))
        self.add_frame(surface, omit=True)
        self.add_frameset(0, name="spewing")
        blank = Surface(self.location.size)
        blank.set_colorkey((0, 0, 0))
        self.add_frame(blank, omit=True)
        self.add_frameset([0, 1], self.parent.blink_rate, "queued")

    def reset(self):
        self.halt(self.spew)
        self.set_frameset("queued")
        self.active = False
        self.queue_reset = False
        limit = self.display_surface.get_rect()
        self.location.midleft = randrange(0, limit.w - self.location.w), limit.h
        self.direction = -1

    def queue_spew(self):
        self.active = True
        self.play(self.spew, delay=self.delay)

    def spew(self):
        self.set_frameset("spewing")
        self.move(0, self.direction * self.speed)
        limit = self.parent.parent.platforms[0].location.top - self.peak
        if self.direction == -1 and self.location.centery <= limit:
            self.location.centery = limit
            self.direction = 1
        elif self.direction == 1 and \
             self.location.top >= self.display_surface.get_height():
            self.queue_reset = True
        if self.location.colliderect(self.parent.parent.food):
            self.parent.parent.food.freeze()

    def update(self):
        if self.active:
            Sprite.update(self)
        if self.queue_reset:
            self.reset()
from math import atan, degrees, radians, sqrt, sin, cos
from random import randint, randrange

from pygame import Surface
from pygame.transform import rotate

from lib.pgfw.pgfw.Sprite import Sprite

class Missile(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.load_configuration()
        self.set_step()
        self.set_frames()
        self.register(self.fly)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("missile")
        self.margin = config["margin"]
        self.speed = config["speed"]
        self.peak = config["peak"]
        self.delay = config["delay"]
        self.angle = config["angle"]

    def set_step(self):
        angle = radians(self.angle)
        self.step = sin(angle) * self.speed, cos(angle) * self.speed

    def set_frames(self):
        surface = Surface((8, 32))
        surface.fill((255, 0, 0))
        surface.set_colorkey((255, 0, 255))
        self.add_frame(rotate(surface, self.angle), omit=True)
        self.add_frameset(0, name="flying")
        blank = Surface(self.location.size)
        blank.set_colorkey((0, 0, 0))
        self.add_frame(blank, omit=True)
        self.add_frameset([0, 1], self.parent.blink_rate, "queued")

    def reset(self):
        self.halt(self.fly)
        self.active = False
        self.queue_reset = False
        self.location.center = randrange(40, 640), 0
        self.set_frameset("queued")

    def is_flying(self):
        return self.is_playing(self.fly)

    def queue_fly(self):
        self.active = True
        self.play(self.fly, delay=self.delay)

    def fly(self):
        self.set_frameset("flying")
        self.move(*self.step)
        location = self.location
        if location.colliderect(self.parent.parent.food):
            self.parent.parent.food.freeze()
        if location.top > self.display_surface.get_height():
            self.queue_reset = True

    def update(self):
        if self.active:
            Sprite.update(self)
        if self.queue_reset:
            self.reset()
from lib.pgfw.pgfw.Sprite import Sprite

class Blob(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_from_path(self.get_resource("blob", "path"), True, True,
                            query="*.png")
        self.hide()

    def hide(self):
        self.visible = False

    def show(self):
        self.visible = True

    def update(self):
        if self.visible:
            if not self.parent.horizontal:
                self.location.centerx = self.parent.parent.food.location.centerx
            else:
                self.location.centery = self.parent.parent.food.location.centery
            Sprite.update(self)
216.73.216.33
216.73.216.33
216.73.216.33
 
June 23, 2019

is pikachu dead

yes and how about that for a brain tickler that what you're seeing all along was a ghost. we used a digital stream of bits that in the future we call blood to recreate everything as a malleable substance that is projected through computers over a massive interstellar network that runs faster than the speed of light in order to simultaneously exist at every moment in time exactly the same way effectively creating a new dimension through which you can experience the timeless joy of video games. you can press a button and watch the impact of your actions instantaneously resonate eternally across an infinite landscape as you the master of a constantly regenerating universe supplant your reality with your imagination giving profoundly new meaning to the phrase what goes around comes around as what comes around is the manifestation of the thoughts you had before you were aware of them. thoughts before they were thought and actions before they were done! it's so revolutionary we saved it for 10,000 years from now but it's all recycled here in the past with you at the helm and the future at the tips of your fingers