from random import choice
from lib.pgfw.pgfw.Sprite import Sprite

class Gun(Sprite):

    def __init__(self, parent, path):
        Sprite.__init__(self, parent)
        self.load_from_path(path, True)
        self.set_framerate(self.get_configuration("gun", "framerate"))
        self.reset()

    def reset(self):
        self.hide()
        self.unfollow()

    def hide(self):
        self.visible = False

    def unfollow(self):
        self.following = False

    def show(self):
        self.visible = True

    def follow(self, food):
        self.food = food
        self.following = True

    def update(self):
        if self.visible:
            if self.following:
                self.location.centerx = self.food.location.centerx
            Sprite.update(self)
from os import listdir
from os.path import join

from pygame import Surface

from lib.pgfw.pgfw.GameChild import GameChild
from food_spring.gun.Gun import Gun

class GunLibrary(GameChild, list):

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

    def load_configuration(self):
        config = self.get_configuration("gun")
        self.root = config["path"]

    def set_guns(self):
        for ii in xrange(4):
            self.append(Guns(self, self.get_resource(join(self.root, str(ii)))))


class Guns(GameChild, list):

    def __init__(self, parent, root):
        GameChild.__init__(self, parent)
        for path in sorted(listdir(root)):
            self.append(Gun(self, join(root, path)))
        self.reset()

    def reset(self):
        for gun in self:
            gun.reset()
            gun.unfollow()

    def hide(self, exclude=None):
        for gun in self:
            gun.hide()
        if exclude is not None:
            self[exclude].show()

    def update(self):
        for gun in self:
            gun.update()
from pygame import Surface

from lib.pgfw.pgfw.Animation import Animation
from food_spring.introduction.Epithet import Epithet

class Introduction(Animation):

    def __init__(self, parent):
        Animation.__init__(self, parent)
        self.display_surface = self.get_display_surface()
        self.audio = self.get_audio()
        self.delegate = self.get_delegate()
        self.audio_path = self.get_resource("introduction", "audio")
        self.set_background()
        self.epithet = Epithet(self)
        self.spanky = parent.spanky
        self.reset()
        self.deactivate()
        self.subscribe(self.respond)

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

    def respond(self, event):
        if self.active:
            if self.delegate.compare(event, "any"):
                self.deactivate()
                self.parent.title.queue_activation()

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

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

    def activate(self):
        self.active = True
        self.audio.play_bgm(self.audio_path)
        self.spanky.location.midbottom = \
                                       self.display_surface.get_rect().midbottom

    def update(self):
        if self.active:
            self.clear()
            Animation.update(self)
            self.parent.gaia.swapper.update()
            self.epithet.update()
            self.spanky.update()

    def clear(self):
        for rect in (self.parent.gaia.swapper.rect, self.spanky.location):
            self.display_surface.blit(self.background, rect, rect)
        self.epithet.clear()
from random import randint

from pygame import Rect, Surface, Color
from pygame.font import Font

from lib.pgfw.pgfw.GameChild import GameChild
from lib.pgfw.pgfw.Sprite import Sprite

class Epithet(GameChild, Rect):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.load_configuration()
        self.init_rect()
        self.set_glyphs()

    def load_configuration(self):
        config = self.get_configuration("epithet")
        self.font_path = self.get_resource("display", "font-path")
        self.width = config["width"]
        self.margin = config["margin"]
        self.text = config["text"]
        self.color = config["color"]
        self.i_color = config["i-color"]
        self.t_color = config["t-color"]
        self.font_size = config["font-size"]
        self.it_size = config["it-size"]

    def init_rect(self):
        Rect.__init__(self, 0, 0, self.width, 0)
        self.midtop = self.get_display_surface().get_rect().centerx, self.margin

    def set_glyphs(self):
        glyphs = []
        for ii, character in enumerate(self.text):
            if character != " ":
                color = None
                if character in "IT":
                    size = self.it_size
                    italic = True
                    bold = True
                    if character == "I":
                        color = self.i_color
                    elif character == "T":
                        color = self.t_color
                else:
                    size = self.font_size
                    italic = False
                    bold = False
                glyphs.append(Glyph(self, character, color, size, bold, italic,
                                    ii))
        self.glyphs = glyphs

    def update(self):
        for glyph in self.glyphs:
            glyph.update()

    def clear(self):
        parent = self.parent
        for glyph in self.glyphs:
            for location in glyph.locations:
                parent.display_surface.blit(parent.background, location,
                                            location)


class Glyph(Sprite):

    def __init__(self, parent, character, color, size, bold, italic, ii):
        Sprite.__init__(self, parent, randint(40, 120))
        self.set_frames(character, size, color, bold, italic)
        self.place(ii)
        self.add_location(offset=(-5, 8))

    def set_frames(self, character, size, color, bold, italic):
        color = Color(0, 0, 0)
        background_color = Color(0, 0, 0)
        count = 30
        font = Font(self.parent.font_path, size)
        font.set_italic(italic)
        font.set_bold(bold)
        for ii in xrange(count):
            hue = randint(0, 255)
            color.hsla = hue, 100, 50, randint(30, 100)
            background_hue = hue + 128
            if background_hue > 255:
                background_hue -= 255
            background_color.hsla = background_hue, 100, 50, randint(30, 100)
            frame = font.render(character, True, color, background_color)
            if not ii % (count / 6):
                surface = Surface(frame.get_size())
                surface.set_colorkey((0, 0, 0))
                midpoint = frame.get_width() / 2
                surface.blit(frame, (midpoint, 0))
                surface.blit(frame, (-midpoint, 0))
                frame = surface
            self.add_frame(frame)

    def place(self, ii):
        parent = self.parent
        offset = int(parent.w * float(ii) / (len(parent.text) - 1))
        self.location.center = parent.left + offset, parent.top
216.73.216.209
216.73.216.209
216.73.216.209
 
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.