from pygame.image import load

from dark_stew.pgfw.Sprite import Sprite

class Clouds(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.dx = -self.get_configuration("clouds", "speed")
        self.load_from_path(self.get_resource("clouds", "path"), True)

    def update(self):
        self.move(self.dx)
        Sprite.update(self)

    def draw(self):
        rect = self.rect
        offset = rect.left + rect.w
        self.display_surface.blit(self.get_current_frame(), rect)
        Sprite.draw(self)
from dark_stew.pgfw.Game import Game
from dark_stew.pgfw.Configuration import TypeDeclarations
from dark_stew.World import World
from dark_stew.monster.Monsters import Monsters

class DarkStew(Game):

    def __init__(self):
        Game.__init__(self, type_declarations=Types())

    def set_children(self):
        Game.set_children(self)
        self.world = World(self)
        self.monsters = Monsters(self)

    def update(self):
        self.world.update()
        self.monsters.update()


class Types(TypeDeclarations):

    additional_defaults = {

        "joy": {"int": ["run", "action"]},

        "world": {"int-list": "dimensions",

                  "int": ["walk-step", "run-step"],

                  "path": "audio-path"},

        "floor": {"path": ["tile-path", "film-path"],

                  "int": "film-opacity"},

        "water": {"float-list": "speed",

                  "path": "tile-path",

                  "int-list": ["color", "opacity"]},

        "pool": {"int": ["framerate", "padding"],

                 "path": ["water-path", "ring-path", "led-path"]},

        "stool": {"path": "path",

                  "float-list": ["angles", "offsets"]},

        "led": {"path": "path",

                "float": ["angle", "offset"]},

        "aphids": {"path": ["path", "animation-path", "moving-path",
                            "standing-path", "sitting-path", "back-path",
                            "front-path", "side-path", "rod-path", "line-path"],

                   "int": ["rest-framerate", "walk-framerate", "run-framerate"],

                   "int-list": "collision-rect",

                   "float": ["initial-chance", "chance-increase"]},

        "monsters": {"path": "path",

                     "int": ["shadow-offset", "shadow-alpha"]},

        }
from pygame import Surface
from pygame.image import load
from pygame.draw import circle
from pygame.locals import *

from dark_stew.pgfw.GameChild import GameChild

class Floor(GameChild, Surface):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.input = self.get_input()
        self.load_configuration()
        self.init_surface()
        self.paint()
        self.add_film()

    def load_configuration(self):
        config = self.get_configuration("floor")
        self.tile_path = self.get_resource("floor", "tile-path")
        self.film_path = self.get_resource("floor", "film-path")
        self.film_opacity = config["film-opacity"]

    def init_surface(self):
        Surface.__init__(self, self.parent.size)

    def paint(self):
        tile = load(self.tile_path)
        self.fill_tile(tile)

    def fill_tile(self, tile, blend=0):
        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), None, blend)

    def add_film(self):
        tile = load(self.film_path).convert_alpha()
        tile.set_alpha(self.film_opacity)
        self.fill_tile(tile, BLEND_ADD)

    def add_holes(self):
        for pool in self.parent.pools:
            self.fill(self.transparent_color, pool)

    def draw(self):
        surface = self.display_surface
        for corner in self.parent.get_corners():
            surface.blit(self, corner)
from pygame import Surface
from pygame.image import load

from dark_stew.pgfw.GameChild import GameChild

class Monster(GameChild):

    def __init__(self, parent, path):
        GameChild.__init__(self, parent)
        self.path = path
        self.display_surface = self.get_display_surface()
        self.set_image()
        self.set_shadow()

    def set_image(self):
        image = load(self.path).convert()
        rect = image.get_rect()
        rect.center = self.display_surface.get_rect().center
        offset = self.parent.shadow_offset / 2
        rect.move_ip(-offset, -offset)
        self.image = image
        self.image_rect = rect

    def set_shadow(self):
        shadow = Surface(self.image.get_size())
        parent = self.parent
        shadow.fill(parent.shadow_color)
        rect = shadow.get_rect()
        rect.center = self.display_surface.get_rect().center
        offset = parent.shadow_offset / 2
        rect.move_ip(offset, offset)
        shadow.set_alpha(parent.shadow_alpha)
        self.shadow = shadow
        self.shadow_rect = rect

    def draw(self):
        surface = self.display_surface
        surface.blit(self.shadow, self.shadow_rect)
        surface.blit(self.image, self.image_rect)
from os import listdir
from os.path import join
from random import choice

from pygame import Color

from dark_stew.pgfw.GameChild import GameChild
from dark_stew.monster.Monster import Monster

class Monsters(GameChild, list):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.current = None
        self.delegate = self.get_delegate()
        self.load_configuration()
        self.add_monsters()

    def load_configuration(self):
        config = self.get_configuration("monsters")
        self.shadow_color = Color(config["shadow-color"])
        self.shadow_offset = config["shadow-offset"]
        self.shadow_alpha = config["shadow-alpha"]
        self.path = self.get_resource("monsters", "path")

    def add_monsters(self):
        root = self.path
        for path in [join(root, name) for name in sorted(listdir(root))]:
            self.append(Monster(self, path))

    def open_random(self):
        self.current = choice(self)

    def close(self):
        self.current = None

    def update(self):
        if self.current:
            self.current.draw()
3.236.209.138
3.236.209.138
3.236.209.138
 
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 I 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.