from pygame.image import load

from lib.pgfw.pgfw.GameChild import GameChild

class Title(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.delegate = self.get_delegate()
        self.audio = self.get_audio()
        self.load_configuration()
        self.set_background()
        self.subscribe(self.respond)
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("title")
        self.background_path = self.get_resource("title", "background")
        self.audio_path = self.get_resource("title", "audio")

    def set_background(self):
        self.background = load(self.background_path).convert()

    def respond(self, event):
        if self.active:
            if self.delegate.compare(event, "any"):
                self.deactivate()
                self.parent.home.activate()
        if self.activate_queued:
            self.activate()
            self.activate_queued = False

    def reset(self):
        self.activate_queued = False
        self.deactivate()

    def deactivate(self):
        self.active = False
        self.audio.stop_current_channel()

    def activate(self):
        self.active = True
        self.audio.play_bgm(self.audio_path)

    def queue_activation(self):
        self.activate_queued = True

    def update(self):
        if self.active:
            self.display_surface.blit(self.background, (0, 0))
from os.path import join

from pygame import Surface
from pygame.font import Font
from pygame.locals import *

from lib.pgfw.pgfw.Animation import Animation
from food_spring.level.land.Land import Land
from food_spring.level.platform.Platforms import Platforms
from food_spring.level.Food import Food
from food_spring.level.planet.Planet import Planet
from food_spring.level.stars.Stars import Stars
from food_spring.level.drop.Drops import Drops
from food_spring.level.door.Door import Door
from food_spring.level.ExitArrow import ExitArrow
from food_spring.level.obstacle.Obstacles import Obstacles
from food_spring.level.Window import Window

class Level(Animation):

    any_press_ignored = "left"
    transparent_color = 255, 0, 255

    def __init__(self, parent, index, horizontal_drop=False):
        Animation.__init__(self, parent)
        self.index = index
        self.display_surface = self.get_display_surface()
        self.input = self.get_input()
        self.compare = self.get_delegate().compare
        self.audio = self.get_audio()
        self.timer = self.get_game().timer
        self.siphon = self.get_game().siphon
        self.velocity = [0, 0]
        self.time = 0.0
        self.altitude = 0
        self.load_configuration()
        self.assign_defaults()
        self.set_background()
        self.land = Land(self)
        self.planet = Planet(self)
        self.stars = Stars(self)
        self.guns = self.parent.parent.gun_library[index]
        self.drops = Drops(self)
        self.platforms = Platforms(self)
        self.food = Food(self)
        self.door = Door(self)
        self.exit_arrow = ExitArrow(self)
        self.obstacles = Obstacles(self)
        self.window = Window(self)
        self.saved_food_surface = self.food.display_surface
        self.subscribe(self.respond)
        self.register(self.go, self.stall, self.enter, self.transition_to_go,
                      self.exit, self.fade_in_arrow)
        self.deactivate()

    def load_configuration(self):
        config = self.get_configuration("level")
        self.background_color = config["background-color"]
        self.gravity = config["gravity"]
        self.velocity_range = config["velocity"]
        self.stall_length = config["stall"]
        self.fall_pause = config["fall-pause"]
        self.entrance_offset = config["entrance-offset"]
        self.entrance_speed = config["entrance-speed"]
        self.audio_root = config["audio"]

    def assign_defaults(self):
        self.distance = 0.0
        self.velocity[0] = 0.0
        self.time = 0.0
        self.reset_queued = False

    def set_background(self):
        surface = Surface(self.display_surface.get_size())
        surface.fill(self.background_color)
        self.background = surface

    def deactivate(self):
        self.active = False
        self.halt()
        self.input.unregister_any_press_ignore(self.any_press_ignored)
        self.restore_food_surface()
        self.audio.stop_current_channel()

    def restore_food_surface(self):
        self.food.display_surface = self.saved_food_surface

    def respond(self, event):
        if self.compare(event, "reset-game"):
            self.deactivate()
        elif self.active and self.compare(event, "left") and \
                 self.exit_available and self.is_playing(check_all=True):
            self.halt()
            self.timer.stop()
            self.velocity[0] = 0.0
            food = self.food.location
            difference = self.platforms[0].location.right - food.right
            rect = self.get_entrance_mask()[1]
            food.bottomright = rect.w - difference, rect.h
            self.play(self.exit)

    def reset(self):
        self.assign_defaults()
        self.land.reset()
        self.drops.reset()
        self.platforms.reset()
        self.food.reset()
        self.door.reset()
        self.exit_arrow.reset()
        self.obstacles.reset()
        self.window.reset()

    def activate(self):
        self.active = True
        self.exit_available = False
        self.siphon.set_level(self.index)
        self.reset()
        self.input.register_any_press_ignore(self.any_press_ignored)
        mask, rect = self.get_entrance_mask()
        self.food.location.bottomleft = -self.entrance_offset, rect.h
        self.saved_food_surface = self.food.display_surface
        self.audio.play_bgm(self.get_resource(join(self.audio_root,
                                                   str(self.index) + ".ogg")))
        self.play(self.enter)

    def get_entrance_mask(self):
        base = self.door.foreground.location
        width = self.platforms[0].location.right - base.right
        mask = Surface((width, base.h), SRCALPHA)
        rect = mask.get_rect()
        rect.topleft = base.topright
        return mask, rect

    def enter(self):
        self.food.move(self.entrance_speed)
        mask, rect = self.get_entrance_mask()
        self.food.display_surface = mask
        self.clear_and_update_children()
        self.display_surface.blit(mask, rect)
        if self.food.location.left >= self.food.offset - rect.left:
            self.restore_food_surface()
            self.food.place_at_start()
            self.halt()
            self.play(self.stall)
            self.play(self.transition_to_go, delay=self.stall_length)

    def go(self):
        self.distance += self.velocity[0]
        self.clear_and_update_children()
        self.accelerate()
        self.time += 1
        if self.reset_queued:
            self.reset()
            self.halt()
            self.timer.stop()
            self.exit_available = True
            self.play(self.stall, delay=self.fall_pause)
            self.play(self.fade_in_arrow, delay=self.fall_pause)
            self.play(self.transition_to_go,
                      delay=self.stall_length + self.fall_pause)

    def stall(self):
        self.clear_and_update_children()

    def transition_to_go(self):
        self.halt()
        self.velocity[0] = self.velocity_range[0]
        self.timer.start()
        self.play(self.go)

    def fade_in_arrow(self):
        self.exit_arrow.fade(out=False)

    def exit(self):
        self.food.move(-self.entrance_speed)
        mask, rect = self.get_entrance_mask()
        self.food.display_surface = mask
        self.clear_and_update_children()
        self.display_surface.blit(mask, rect)
        if self.food.location.left <= -self.entrance_offset:
            self.restore_food_surface()
            self.halt()
            self.deactivate()
            self.get_game().home.activate()

    def queue_reset(self):
        self.reset_queued = True

    def is_going(self):
        return self.is_playing(self.go)

    def update(self):
        if self.active:
            Animation.update(self)

    def clear_and_update_children(self):
        self.clear()
        self.stars.update()
        self.planet.update()
        self.siphon.update()
        self.land.update()
        self.door.background.update()
        self.exit_arrow.update()
        self.guns.update()
        if not self.food.scope.active:
            self.food.update()
        self.door.foreground.update()
        self.drops.update()
        self.platforms.update()
        if self.food.scope.active:
            self.food.update()
        self.obstacles.update()
        self.window.update()

    def clear(self):
        self.display_surface.blit(self.background, (0, 0))

    def accelerate(self):
        time = self.time
        minimum, maximum = self.velocity_range
        self.velocity[0] =  minimum + time * maximum / (2000 + time)
        # self.print_velocity()

    def print_velocity(self):
        surface = Font(None, 24).render("%.2f" % self.velocity[0], False,
                                        (255, 255, 255))
        self.get_display_surface().blit(surface, (0, 0))
216.73.216.124
216.73.216.124
216.73.216.124
 
March 3, 2021

Video 📺

Computers are a gun. They can see the target; they can pull the trigger. Computers were made by the military to blow people's brains out if they stepped out of line. Google Coral is the same technology that pollutes the oceans, and so is the computer I'm using, and so are the platforms I'm using to post this.

Game 🎲

Games are a context in which all play is purposeful. Games expose the fundamentally nihilistic nature of the universe and futility of pursuing any path other than the inevitability of death and the torture of an evil that knows and exploits absolute freedom. Games are not educational; they are education.

Propaganda 🆒

Education is propaganda — ego driven by-product conveying nothing that would enable us to expose that vanities made for gain subject us further to an illusion created by those in control: the illusion that quantity can represent substance and that data or observation can replace meaning. And why say it, or how, without contradicting yourself, that everything, once registered, no longer exists, and in fact never did, exists only in relation to other non-existent things, and when you look, it's not there, not only because it's long vanished, but because where would it be?


fig. 2: Gamer goo is a lubricant — not for your skin, but for facilitating your ability to own the competition (image from Gamer goo review)

As a result of video games, the great Trojan horse 🎠 of imperialist consumerist representationalism, people are divided in halves to encourage them to act according to market ordained impulses, to feign assurance, penetrating themselves deeper into a tyranny from which every action signals allegiance, confusing the world with definitions and borders, constantly struggling to balance or brace themselves against forces that threaten the crumbling stability of their ego.

F

or example, a cup 🥃 is designed and built to hold something, maintain order and prevent chaos. It keeps water from spilling back to where it belongs, back where it wants to go and gravity wants it to go. The cup is a trap, and it is used to assert dominance over nature, to fill with thoughts about existence, time and self, thoughts regarding dissimilarity between equal parts and patterns that manifest in variation. These ruminations disguised as revelations boil away to reveal isolated and self-aggrandizing thoughts about an analogy fabricated to herald the profundity of one's campaign's propaganda. You have no authentic impulse except to feed a delusion of ultimate and final supremacy. That is why you play games. That is your nature. That is why you eventually smash the cup to bits 💥 or otherwise watch it disintegrate forever because it, by being useful, threatens your facade of ownership and control.


fig. 3: worth1000

The cup is you; it reflects you; it is a lens through which you see yourself; it reassures you, confirming your presence; it says something, being something you can observe. When you move, it moves, and it opens after being closed. You can use it as a vessel for penetration fantasies, keeping you warm and fertile, a fine host for the plague of consciousness, you reptile, you sun scorched transgressor that not only bites the hand that feeds, but buries it deep within a sterile chamber where nothing remains for it as a means of escape except the corpses of others that infringed upon your feeding frenzy.