from random import randint
from operator import sub

from pygame import Surface

from esp_hadouken.GameChild import *

class Barrier(GameChild, Surface):

    dir_r, dir_l = 1, -1

    def __init__(self, parent, y, sibling=None):
        GameChild.__init__(self, parent)
        self.y = y
        self.sibling = sibling
        self.init_surface()

    def init_surface(self):
        size = self.determine_size()
        Surface.__init__(self, (size, size))
        self.fill(self.parent.transparent_color)
        self.set_rect()

    def determine_size(self):
        parent = self.parent
        size_range = parent.size_range
        pos = float(self.y) / -sub(*parent.y_range)
        return pos * -sub(*size_range) + size_range[0]

    def set_rect(self):
        rect = self.get_rect()
        rect.top = self.y
        sibling = self.sibling
        if not sibling:
            growth = self.dir_r
            rect.top = self.y
            rect.left = self.generate_initial_x()
        else:
            growth = sibling.growth
            if growth == self.dir_r:
                rect.left = sibling.rect.right
                if rect.right > self.parent.get_width():
                    growth = self.dir_l
                    rect.right = sibling.rect.left
            if growth == self.dir_l:
                rect.right = sibling.rect.left
                if rect.left < 0:
                    growth = self.dir_r
                    rect.left = sibling.rect.right
        self.growth = growth
        self.rect = rect
        self.x = rect.left
        self.set_heading()
        self.set_step()

    def generate_initial_x(self):
        parent = self.parent
        return randint(0, parent.get_width() - parent.size_range[0])

    def set_heading(self):
        if self.rect.centerx > self.parent.get_width() / 2:
            heading = self.dir_l
        else:
            heading = self.dir_r
        self.heading = heading

    def set_step(self):
        parent = self.parent
        center = parent.get_width() / 2
        rnge = abs((self.rect.centerx - center) * 2)
        self.step = float(rnge) / parent.step_limit

    def toggle_heading(self):
        heading = self.heading
        if heading == self.dir_l:
            heading = self.dir_r
        else:
            heading = self.dir_l
        self.heading = heading

    def update(self):
        self.move()
        self.draw()

    def move(self):
        self.x += self.heading * self.step
        self.rect.left = self.x
        
    def draw(self):
        self.parent.area.blit(self, self.rect)
from esp_hadouken.levels.Level import *
from Gauntlet import *

class Horse(Level):

    def __init__(self, parent):
        Level.__init__(self, parent)

    def set_void(self):
        self.void = Gauntlet(self)
from random import randint
from operator import sub

from pygame import draw

from esp_hadouken.GameChild import *

class Bubble(GameChild):

    def __init__(self, parent, y=None):
        GameChild.__init__(self, parent)
        self.y = y
        self.set_x()

    def set_x(self):
        self.x = self.parent.get_width() / 2

    def update(self):
        self.y += self.parent.scroll_speed
        self.set_radius()

    def set_radius(self):
        parent = self.parent
        radius_range = parent.radius_range
        pos = float(self.y) / -sub(*parent.y_range)
        self.radius = int(pos * -sub(*radius_range) + radius_range[0])

    def draw(self):
        parent = self.parent
        center = self.x, self.y
        draw.circle(parent.area, parent.transparent_color, center, self.radius)
from random import randint

from pygame import Color, Surface

from esp_hadouken import levels
from Bubble import *

class Void(levels.Void.Void):

    def __init__(self, parent):
        levels.Void.Void.__init__(self, parent)
        self.iterations = 0
        self.read_configuration()
        self.set_area()
        self.show()

    def read_configuration(self):
        config = self.get_configuration()
        self.switch_frequency = config["tooth-level-switch-frequency"]
        self.scroll_speed = config["tooth-level-scroll-speed"]
        self.padding = config["tooth-level-void-padding"]
        self.radius_range = config["tooth-level-radius-range"]
        self.spawn_range = config["tooth-level-spawn-range"]

    def set_area(self):
        self.set_y_range()
        y_range = self.y_range
        height = y_range[1] - y_range[0]
        area = Surface((self.parent.get_width(), height)).convert()
        self.area_bg = Surface(area.get_size()).convert()
        self.area = area
        self.generate_bubbles()

    def set_y_range(self):
        padding = self.padding
        parent = self.parent
        start = parent.bandit.rect.bottom + padding[0]
        end = parent.get_height() - padding[1]
        self.y_range = start, end

    def generate_bubbles(self):
        self.bubbles = []
        y = self.get_height()
        while y > -self.radius_range[0]:
            self.add_bubble(y)
            y -= self.next_spawn + self.radius_range[0]

    def add_bubble(self, y=None):
        if y is None:
            y = -self.radius_range[0]
        self.bubbles.insert(0, Bubble(self, y))
        self.next_spawn = randint(*self.spawn_range)

    def toggle(self):
        if self.visible:
            self.hide()
        else:
            self.show()

    def show(self):
        self.visible = True

    def hide(self):
        self.visible = False

    def update_area(self):
        self.update_bubbles()
        iterations = self.iterations + 1
        if 1.0 / iterations <= self.switch_frequency:
            self.toggle()
            iterations = 0
        if self.visible:
            self.clear_area()
            self.draw_area()
        self.iterations = iterations

    def update_bubbles(self):
        bubbles = self.bubbles
        radius_range = self.radius_range
        if bubbles[0].y - radius_range[0] > self.next_spawn:
            self.add_bubble()
        for bubble in bubbles:
            if bubble.y > self.y_range[1] + radius_range[1]:
                bubbles.remove(bubble)
            else:
                bubble.update()

    def clear_area(self):
        self.area.blit(self.area_bg, (0, 0))

    def draw_area(self):
        self.draw_bubbles()
        self.blit(self.area, (0, self.y_range[0]))

    def draw_bubbles(self):
        for bubble in self.bubbles:
            bubble.draw()
3.145.61.202
3.145.61.202
3.145.61.202
 
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.