from random import choice, randrange

from pygame import Surface
from pygame.mixer import Sound

from _send.pgfw.Sprite import Sprite
from _send.Send import SoundEffect

class Cup(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.set_frame()
        self.set_color()
        self.direction = choice((1, -1))
        self.moving = True
        self.wall_audio = SoundEffect(self.get_resource("cup", "wall-audio"),
                                      .8)

    def set_frame(self):
        size = self.get_size()
        surface = Surface((size, size))
        self.add_frame(surface)
        self.place()
        self.align()

    def get_size(self):
        return self.parent.cup_scale * self.display_surface.get_height() * \
               (1 - self.get_configuration("sideline", "proportion") * 2)

    def place(self):
        sidelines = self.parent.parent.sidelines
        self.rect.top = randrange(sidelines[0].bottom,
                                  sidelines[1].top - self.rect.h)

    def align(self):
        self.rect.right = self.display_surface.get_rect().right

    def set_color(self):
        self.color = self.parent.get_foreground_color()
        self.paint()

    def paint(self):
        self.get_current_frame().fill(self.color)

    def stop(self):
        self.moving = False

    def update(self):
        if self.moving:
            self.move(dy=self.parent.speed * self.direction)
            self.collide()
        Sprite.update(self)

    def collide(self):
        for sideline in self.parent.parent.sidelines:
            if self.location.colliderect(sideline):
                self.direction *= -1
                self.move(dy=sideline.clip(self.location).h * self.direction)
                self.wall_audio.play()
from pygame import Color, Surface, Rect
from pygame.time import get_ticks
from pygame.draw import circle
from pygame.mixer import Sound

from _send.pgfw.GameChild import GameChild
from _send.Send import SoundEffect

class Charge(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.delegate = self.get_game().delegate
        self.display_surface = self.get_display_surface()
        self.charging_audio = SoundEffect(self.get_resource("charge",
                                                            "charging-audio"),
                                          .55)
        self.send_audio = SoundEffect(self.get_resource("charge",
                                                        "send-audio"), .1)
        self.load_configuration()
        self.subscribe(self.respond)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("charge")
        self.transparent_color = Color(*config["transparent-color"])
        self.colors = tuple(Color(color + "ff") for color in config["colors"])
        self.peak_time = config["peak-time"]
        self.size_limits = config["size-limits"]
        self.margin = config["margin"]

    def respond(self, event):
        fields = self.parent
        if not fields.loading and not fields.suppressing_input and \
               fields.get_current_field():
            if not self.sent and self.delegate.compare(event, "charge"):
                self.charging = True
                self.start = get_ticks()
            elif self.charging and self.delegate.compare(event, "charge", True):
                self.sent = True
                self.charging = False
                self.parent.get_current_field().ball.launch(self.get_strength())
                self.send_audio.play()

    def reset(self):
        self.charging = False
        self.start = None
        self.sent = False
        self.color_index = 0
        self.last_strength = None

    def get_strength(self):
        return float((get_ticks() - self.start) % self.peak_time) / \
               self.peak_time

    def update(self):
        if not self.sent and self.charging:
            self.increment_color_index()
            lower, upper = 4, 150
            if self.last_strength is None or \
                   self.last_strength > self.get_strength():
                self.charging_audio.play()
            strength = self.last_strength = self.get_strength()
            width = strength * (upper - lower) + lower
            lower, upper = 1, 22
            height = strength * (upper - lower) + lower
            rect = Rect(0, 0, width, height)
            rect.midbottom = self.parent.sidelines[1].midtop
            self.display_surface.fill(self.get_color(), rect)

    def increment_color_index(self):
        self.color_index += 1
        if self.color_index == len(self.colors):
            self.color_index = 0

    def get_color(self):
        return self.colors[self.color_index]
from pygame import Surface
from pygame.mixer import Sound

from _send.pgfw.Sprite import Sprite
from _send.Send import SoundEffect

class Ball(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.set_frame()
        self.set_color()
        self.adjust_for_size()
        self.reset()
        self.reflect_audio = SoundEffect(self.get_resource("ball",
                                                           "reflect-audio"),
                                         .35)

    def set_frame(self):
        size = self.get_size()
        surface = Surface((size, size))
        self.add_frame(surface)
        self.center()

    def get_size(self):
        return self.parent.ball_scale * self.display_surface.get_height() * \
               (1 - self.get_configuration("sideline", "proportion") * 2)

    def center(self):
        self.rect.centery = self.display_surface.get_rect().centery

    def set_color(self):
        self.color = self.parent.get_foreground_color()
        self.paint()

    def paint(self):
        self.get_current_frame().fill(self.color)

    def adjust_for_size(self):
        lower, upper = self.get_configuration("ball", "base-velocity-range")
        ratio = self.rect.w / float(self.get_configuration("ball", "base-size"))
        self.velocity_range = ratio * lower, ratio * upper
        self.deceleration = ratio * self.get_configuration("ball",
                                                           "base-deceleration")

    def reset(self):
        self.velocity = 0

    def launch(self, strength):
        lower, upper = self.velocity_range
        self.velocity = strength * (upper - lower) + lower
        self.direction = 1

    def update(self):
        if self.velocity:
            self.move(self.velocity * self.direction)
            if self.rect.right >= self.display_surface.get_rect().right:
                self.direction = -1
                self.move(self.display_surface.get_rect().right - \
                          self.rect.right)
                self.reflect_audio.play()
            self.velocity -= self.deceleration
            if self.velocity < 1 or self.rect.right < 0:
                self.velocity = 0
                self.parent.cup.stop()
                self.parent.parent.result.evaluate()
        Sprite.update(self)
        if self.rect.colliderect(self.parent.cup.location):
            self.display_surface.fill(self.parent.get_background_color(),
                                      self.rect.clip(self.parent.cup.location))
3.138.114.140
3.138.114.140
3.138.114.140
 
July 19, 2017


f1. BOSS

Games are corrupt dissolutions of nature modeled on prison, ordering a census from the shadows of a vile casino, splintered into shattered glass, pushing symbols, rusted, stale, charred, ultraviolet harbingers of consumption and violence, badges without merit that host a disease of destruction and decay.

You are trapped. You are so trapped your only recourse of action is to imagine an escape route and deny your existence so fully that your dream world becomes the only reality you know. You are fleeing deeper and deeper into a chasm of self-delusion.

While you're dragging your listless, distending corpus from one cell to another, amassing rewards, upgrades, bonuses, achievements, prizes, add-ons and status boosts in rapid succession, stop to think about what's inside the boxes because each one contains a vacuous, soul-sucking nightmare.

Playing can be an awful experience that spirals one into a void of harm and chaos, one so bad it creates a cycle between the greater and lesser systems, each breaking the other's rules. One may succeed by acting in a way that ruins the world.