from food_spring.level.Level import Level

class Pineapple(Level):

    def __init__(self, parent):
        Level.__init__(self, parent, parent.PINEAPPLE)
from random import randint

from lib.pgfw.pgfw.GameChild import GameChild
from food_spring.level.platform.Platform import Platform

class Platforms(GameChild, list):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.edge = self.display_surface.get_width()
        self.load_configuration()
        self.reset()

    def load_configuration(self):
        config = self.get_configuration("platform")
        self.gap_range = config["gap"]
        self.width_range = config["width"]
        self.first_gap = config["first-gap"]
        self.buffer = config["buffer"]

    def reset(self):
        list.__init__(self, [])
        self.add_first()
        self.populate()

    def add_first(self):
        gap = self.first_gap
        self.append(Platform(self, self.edge, -gap))
        self.add_platform(gap)

    def populate(self):
        while self.get_end() < self.edge:
            self.add_platform()

    def get_end(self):
        if not self:
            return 0
        return self[-1].rect.right

    def add_platform(self, gap=None):
        if gap is None:
            gap = randint(*self.gap_range)
        x = self.get_end() + gap
        self.append(Platform(self, randint(*self.width_range), x))

    def update(self):
        self.retire_platforms()
        self.populate()
        for platform in self:
            platform.update()

    def retire_platforms(self):
        for platform in self:
            if platform.rect.right < -self.buffer:
                self.remove(platform)
from random import randint

from pygame import Surface
from pygame.draw import line

from lib.pgfw.pgfw.Sprite import Sprite

class Platform(Sprite):

    def __init__(self, parent, width, x):
        Sprite.__init__(self, parent)
        self.width = width
        self.load_configuration()
        self.rect.topleft = x, self.display_surface.get_height() - self.height
        self.add_frame()

    def load_configuration(self):
        config = self.get_configuration("platform")
        self.height = config["height"]
        self.thickness = config["thickness"]

    def add_frame(self):
        surface = Surface((self.width, self.thickness))
        surface.fill(self.parent.parent.background_color)
        self.draw_borders(surface)
        Sprite.add_frame(self, surface)

    def draw_borders(self, surface):
        width, height = surface.get_size()
        color = (255, 255, 255)
        line(surface, color, (0, 0), (width - 1, 0))
        line(surface, color, (0, 0), (0, height - 1))
        line(surface, color, (width - 1, 0), (width - 1, height))
        line(surface, color, (0, height - 1), (width - 1, height - 1))

    def update(self):
        self.move(-self.parent.parent.velocity[0])
        Sprite.update(self)
from random import randint, randrange

from pygame import Surface, Color

from lib.pgfw.pgfw.Sprite import Sprite

class Star(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent, randint(100, 1000))
        self.load_configuration()
        self.add_frames()
        self.place()

    def load_configuration(self):
        config = self.get_configuration("stars")
        self.size = config["size"]
        self.saturation = config["saturation"]

    def add_frames(self):
        size = randint(*self.size)
        color = Color(0, 0, 0)
        hue = randint(0, 360)
        for _ in xrange(10):
            color.hsla = hue, randint(*self.saturation), randint(0, 100), 100
            surface = Surface((size, size))
            surface.fill(color)
            self.add_frame(surface)

    def place(self):
        width, height = self.display_surface.get_size()
        self.location.center = randrange(0, width), randrange(0, height)
from random import randint

from lib.pgfw.pgfw.GameChild import GameChild
from food_spring.level.stars.Star import Star

class Stars(GameChild, list):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.load_configuration()
        self.populate()

    def load_configuration(self):
        config = self.get_configuration("stars")
        self.count = config["count"]

    def populate(self):
        for _ in xrange(randint(*self.count)):
            self.append(Star(self))

    def update(self):
        for star in self:
            star.update()
from food_spring.level.Level import Level

class Watermelon(Level):

    def __init__(self, parent):
        Level.__init__(self, parent, parent.WATERMELON)
from lib.pgfw.pgfw.GameChild import GameChild
from food_spring.level.door.Foreground import Foreground
from food_spring.level.door.Background import Background

class Door(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.foreground = Foreground(self)
        self.background = Background(self)

    def reset(self):
        self.foreground.reset()
        self.background.reset()
216.73.216.141
216.73.216.141
216.73.216.141
 
June 29, 2013

A few weeks ago, for Fishing Jam, I made a fishing simulation from what was originally designed to be a time attack arcade game. In the program, Dark Stew, the player controls Aphids, an anthropod who fishes for aquatic creatures living in nine pools of black water.



Fishing means waiting by the pool with the line in. The longer you wait before pulling the line out, the more likely a creature will appear. Aside from walking, it's the only interaction in the game. The creatures are drawings of things you maybe could find underwater in a dream.

The background music is a mix of clips from licensed to share songs on the Free Music Archive. Particularly, Seed64 is an album I used a lot of songs from. The full list of music credits is in the game's README file.

I'm still planning to use the original design in a future version. There would be a reaction-based mini game for catching fish, and the goal would be to catch as many fish as possible within the time limit. I also want to add details and obstacles to the background, which is now a little boring, being a plain, tiled, white floor.

If you want to look at all the drawings or hear the music in the context of the program, there are Windows and source versions available. The source should work on any system with Python and Pygame. If it doesn't, bug reports are much appreciated. Comments are also welcome :)

Dark Stew: Windows, Pygame Source

I wrote in my last post that I would be working on an old prototype about searching a cloud for organisms for Fishing Jam. I decided to wait a while before developing that game, tentatively titled Xenographic Barrier. Its main interactive element is a first-person scope/flashlight, so I'd like to make a Wii version of it.

I'm about to start working on a complete version of Ball & Cup. If I make anything interesting for it, I'll post something. There are a lot of other things I want to write about, like game analyses, my new GP2X and arcades in Korea, and there's still music to release. Lots of fun stuff coming!