from pygame import Surface

from dark_stew.pgfw.GameChild import GameChild
from dark_stew.water.Layer import Layer

class Water(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.load_configuration()
        self.set_background()
        self.add_layers()

    def load_configuration(self):
        config = self.get_configuration("water")
        self.opacity = config["opacity"]
        self.speed = config["speed"]
        self.color = config["color"]

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

    def add_layers(self):
        layers = []
        for ii, opacity in enumerate(self.opacity):
            layers.append(Layer(self, opacity, self.speed[ii], ii * 16))
        self.layers = layers

    def update(self):
        for layer in self.layers:
            layer.update()
        self.draw()

    def draw(self):
        self.display_surface.blit(self.background, (0, 0))
        for layer in reversed(self.layers):
            layer.draw()
from pygame import Surface
from pygame.image import load

from dark_stew.pgfw.GameChild import GameChild

class Layer(GameChild, Surface):

    def __init__(self, parent, opacity, speed, base_offset):
        GameChild.__init__(self, parent)
        self.opacity = opacity
        self.speed = speed
        self.base_offset = base_offset
        self.display_surface = self.get_display_surface()
        self.transparent_color = (255, 0, 255)
        self.offset = 0
        self.set_tile()
        self.init_surface()
        self.paint()

    def set_tile(self):
        path = self.get_resource("water", "tile-path")
        self.tile = load(path).convert_alpha()

    def init_surface(self):
        padding = self.tile.get_width()
        width, height = self.parent.parent.size
        Surface.__init__(self, (width + padding, height + padding))
        transparent_color = self.transparent_color
        self.fill(transparent_color)
        self.set_colorkey(transparent_color)
        self.set_alpha(self.opacity)
        self.padding = padding

    def paint(self):
        tile = self.tile
        for x in xrange(0, self.get_width(), tile.get_width()):
            for y in xrange(0, self.get_height(), tile.get_height()):
                self.blit(tile, (x, y))

    def update(self):
        offset = self.offset - self.speed
        padding = self.padding
        if offset < -padding:
            offset += padding
        self.offset = offset

    def draw(self):
        rect = self.parent.parent.move([int(self.offset)] * 2)
        rect.top += self.base_offset
        self.display_surface.blit(self, rect)
from math import sqrt
from os import listdir
from os.path import isdir, join
from re import match

from dark_stew.pgfw.GameChild import GameChild
from dark_stew.pool.Pool import Pool

class Pools(GameChild, list):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.add_pools()

    def add_pools(self):
        width = self.parent.w
        step = int(float(width) / sqrt(self.count_pools()))
        ii = 0
        for x in xrange(step / 2, width, step):
            for y in xrange(step / 2, width, step):
                self.append(Pool(self, (x, y), ii))
                ii += 1
        self.step = step

    def count_pools(self):
        count = 0
        root = self.get_resource("pool", "water-path")
        for name in listdir(root):
            if match("^[0-9]", name):
                count += 1
        return count

    def update(self):
        for pool in self:
            pool.update()
from os.path import join

from dark_stew.pgfw.Sprite import Sprite

class Ring(Sprite):

    def __init__(self, parent, index):
        Sprite.__init__(self, parent)
        self.index = index
        self.display_surface = self.get_display_surface()
        self.load_from_path(self.build_path(), transparency=True, ppa=False)
        self.rect.center = parent.center

    def build_path(self):
        return join(self.get_resource("pool", "ring-path"),
                    str(self.index) + ".png")

    def draw(self):
        x, y = self.rect.topleft
        frame = self.get_current_frame()
        surface = self.display_surface
        for dx, dy in self.parent.parent.parent.get_corners():
            surface.blit(frame, (x + dx, y + dy))
from os.path import join

from pygame import Surface
from pygame.image import load

from dark_stew.pgfw.Sprite import Sprite

class Water(Sprite):

    def __init__(self, parent, index):
        Sprite.__init__(self, parent)
        self.index = index
        self.display_surface = self.get_display_surface()
        self.transparent_color = (255, 0, 255)
        self.load_configuration()
        self.load_groove()
        self.set_framerate(self.framerate)
        self.load_from_path(join(self.frames_root, str(index)),
                            transparency=True, ppa=False)
        self.rect.center = parent.center

    def load_configuration(self):
        config = self.get_configuration("pool")
        self.framerate = config["framerate"]
        self.frames_root = self.get_resource("pool", "water-path")
        self.groove_path = self.get_resource(join(config["water-path"],
                                                  config["groove-path"]))

    def load_groove(self):
        image = load(join(self.groove_path, str(self.index) + ".png"))
        surface = Surface(image.get_size())
        transparent_color = self.transparent_color
        surface.fill(transparent_color)
        surface.set_colorkey(transparent_color)
        surface.blit(image, (0, 0))
        self.groove = surface

    def draw(self):
        x, y = self.rect.topleft
        frame = self.get_current_frame()
        surface = self.display_surface
        groove = self.groove
        for dx, dy in self.parent.parent.parent.get_corners():
            surface.blit(frame, (x + dx, y + dy))
            surface.blit(groove, (x + dx, y + dy))
216.73.216.212
216.73.216.212
216.73.216.212
 
July 18, 2022


A new era ‼

Our infrastructure has recently upgraded ‼

Nugget Communications Bureau 👍

You've never emailed like this before ‼

Roundcube

Webmail software for reading and sending email from @nugget.fun and @shampoo.ooo addresses.

Mailman3

Email discussion lists, modernized with likes and emojis. It can be used for announcements and newsletters in addition to discussions. See lists for Picture Processing or Scrapeboard. Nowadays, people use Discord, but you really don't have to!

FreshRSS

With this hidden in plain sight, old technology, even regular people like you and me can start our own newspaper or social media feed.

Nugget Streaming Media 👍

The content you crave ‼

HLS

A live streaming, video format based on M3U playlists that can be played with HTML5.

RTMP

A plugin for Nginx can receive streaming video from ffmpeg or OBS and forward it as an RTMP stream to sites like Youtube and Twitch or directly to VLC.


Professional ‼

Nugget Productivity Suite 👍

Unleash your potential ‼

Kanboard

Virtual index cards you can use to gamify your daily grind.

Gitea

Grab whatever game code you want, share your edits, and report bugs.

Nugget Security 👍

The real Turing test ‼

Fail2ban

Banning is even more fun when it's automated.

Spamassassin

The documentation explains, "an email which mentions rolex watches, Viagra, porn, and debt all in one" will probably be considered spam.

GoAccess

Display HTTP requests in real time, so you can watch bots try to break into WordPress.

Nugget Entertainment Software 👍

The best in gaming entertainment ‼

Emoticon vs. Rainbow

With everything upgraded to the bleeding edge, this HTML4 game is running better than ever.


Zoom ‼

The game engine I've been working on, SPACE BOX, is now able to export to web, so I'm planning on turning nugget.fun into a games portal by releasing my games on it and adding an accounts system. The upgraded server and software will make it easier to create and maintain. I'm also thinking of using advertising and subscriptions to support the portal, so some of these services, like webmail or the RSS reader, may be offered to accounts that upgrade to a paid subscription.