from pygame import Surface
from pygame.locals import *
from pygame.image import load

from esp_hadouken.pgfw.GameChild import GameChild

class Glass(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_screen()
        self.load_image()

    def load_image(self):
        self.image = load(self.get_resource("title", "glass-path")).convert()

    def update(self):
        self.display_surface.blit(self.image, (0, 0), None, BLEND_MAX)
from pygame.locals import *
from pygame.image import load
from pygame.font import Font

from esp_hadouken.pgfw.GameChild import GameChild
from esp_hadouken.pgfw.Input import Input
from esp_hadouken.Toy import Toy
from esp_hadouken.title.background.Background import Background
from esp_hadouken.title.menu.Menu import Menu
from esp_hadouken.title.Glass import Glass

class Title(GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.leave_limit = self.get_screen().get_rect().right
        self.audio_path = self.get_resource("title", "audio-path")
        self.toy_position = self.get_configuration("title", "toy-position")
        self.delegate = self.get_delegate()
        self.deactivate()
        self.set_children()
        self.place_toy()
        self.subscribe(self.respond)

    def deactivate(self):
        self.active = False

    def set_children(self):
        self.toy = Toy(self)
        self.background = Background(self)
        self.glass = Glass(self)
        self.menu = Menu(self)

    def place_toy(self):
        self.toy.rect.topleft = self.toy_position

    def respond(self, event):
        compare = self.delegate.compare
        if compare(event, "reset-game"):
            self.activate()
        elif compare(event, "main-menu-selection", option="play"):
            self.deactivate()
        elif compare(event, "main-menu-selection", option="records"):
            self.deactivate()

    def activate(self):
        self.active = True
        self.start_music()

    def start_music(self):
        self.get_audio().play_bgm(self.audio_path)

    def update(self):
        if self.active:
            self.background.update()
            self.toy.update()
            self.glass.update()
            self.menu.update()
from pygame import Rect

from esp_hadouken.pgfw.GameChild import GameChild
from esp_hadouken.title.menu.Option import Option

class Menu(Rect, GameChild):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.display_surface = self.get_screen()
        self.fx = self.get_configuration("main-menu", "select-fx")
        self.delegate = self.get_delegate()
        self.init_rect()
        self.add_options()
        self.subscribe(self.respond)

    def init_rect(self):
        Rect.__init__(self, (0, 0), self.get_configuration("main-menu", "size"))
        self.center = self.display_surface.get_rect().center

    def add_options(self):
        self.options = [Option(self, ii) for ii in range(2)]

    def respond(self, event):
        if self.parent.active:
            compare = self.delegate.compare
            if compare(event, ["left", "right"]):
                play = self.get_audio().play_fx
                post = self.delegate.post
                name = "main-menu-selection"
                if compare(event, "left"):
                    play(self.fx[0])
                    post(name, option="play")
                elif compare(event, "right"):
                    play(self.fx[1])
                    post(name, option="records")

    def apply_to_options(self, name):
        for option in self.options:
            getattr(option, name)()

    def update(self):
        self.apply_to_options("update")
from random import randint

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

from esp_hadouken.pgfw.Sprite import Sprite

class Option(Sprite):

    def __init__(self, parent, index):
        Sprite.__init__(self, parent)
        self.index = index
        self.load_configuration()
        self.set_framerate(self.framerate)
        self.add_frames()
        self.place()

    def load_configuration(self):
        config = self.get_configuration("main-menu")
        self.framerate = config["framerate"]
        self.width = config["option-width"]
        self.frame_count = config["frame-count"]
        self.text_color = config["text-color"]
        self.text_size = config["text-size"]
        self.text = config["option-text"]
        self.background_color_range = config["background-color-range"]
        self.font_path = self.get_resource("main-menu", "font-path")

    def add_frames(self):
        size = self.width, self.parent.h
        for ii in range(self.frame_count):
            surface = Surface(size)
            self.randomize(surface)
            self.add_text(surface)
            self.add_frame(surface)

    def randomize(self, surface):
        pixels = PixelArray(surface)
        for ii, column in enumerate(pixels):
            for jj, pixel in enumerate(column):
                pixels[ii][jj] = self.build_random_color()

    def build_random_color(self):
        color = self.background_color_range
        return randint(*color), randint(*color), randint(*color)

    def add_text(self, parent):
        index, color, antialias = self.index, self.text_color, True
        font = Font(self.font_path, self.text_size)
        if index == 0:
            surface = font.render(self.text[0], antialias, color)
        elif index == 1:
            surface = font.render(self.text[1], antialias, color)
        rect = surface.get_rect()
        rect.center = parent.get_rect().center
        parent.blit(surface, rect)

    def place(self):
        index = self.index
        if index == 0:
            self.rect.topleft = self.parent.topleft
        elif index == 1:
            self.rect.topright = self.parent.topright
from math import pi

from pygame import Surface, Rect
from pygame.draw import arc

from esp_hadouken.pgfw.Sprite import Sprite

class Sky(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.load_configuration()
        self.add_frames()
        self.set_framerate(self.framerate)

    def load_configuration(self):
        config = self.get_configuration("title")
        self.framerate = config["sky-framerate"]
        self.step = config["sky-arc-step"]
        self.arc_thickness = config["sky-arc-thickness"]
        self.arc_color = config["sky-arc-color"]
        self.color = config["sky-color"]

    def add_frames(self):
        for ii in 0, 1:
            offset = -ii * self.step / 2
            surface = Surface(self.display_surface.get_size())
            surface.fill(self.color)
            self.draw_arcs(surface, offset)
            self.add_frame(surface)

    def draw_arcs(self, surface, offset):
        step = self.step
        reference = self.display_surface.get_rect()
        limit = reference.w
        rect = Rect(0, 0, step + offset, step + offset)
        center = reference.centerx, reference.bottom
        rect.center = center
        start_angle = pi / 2
        thickness = self.arc_thickness
        color = self.arc_color
        while rect.w / 2 <= limit:
            arc(surface, color, rect, start_angle, 0, thickness)
            rect.w += step
            rect.h += step
            rect.center = center
18.222.108.18
18.222.108.18
18.222.108.18
 
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.