from esp_hadouken import levels

from Road import *

class Void(levels.Void.Void):

    def __init__(self, parent):
        levels.Void.Void.__init__(self, parent)
        self.read_configuration()
        self.road = Road(self)

    def read_configuration(self):
        config = self.get_configuration()
        prefix = "diortem-level-"
        self.padding = config[prefix + "void-padding"]
        self.segment_width_range = config[prefix + "segment-width-range"]
        self.segment_height_range = config[prefix + "segment-height-range"]
        self.shift_range = config[prefix + "shift-range"]
        self.leg_range = config[prefix + "leg-range"]
        self.scroll_speed = config[prefix + "scroll-speed"]

    def update_area(self):
        self.road.update()
from random import randint

from pygame import Surface, Color, Rect

from esp_hadouken.GameChild import *
from Segment import *

class Road(GameChild, Surface):

    def __init__(self, parent):
        GameChild.__init__(self, parent)
        self.init_surface()
        self.set_background()
        self.set_x_range()
        self.generate_segments()

    def init_surface(self):
        parent = self.parent
        width = parent.get_width()
        padding = parent.padding
        bandit_height = parent.parent.bandit.rect.h
        height = parent.get_height() - sum(padding) - bandit_height
        rect = Rect(0, padding[0] + bandit_height, width, height)
        Surface.__init__(self, rect.size)
        self.convert()
        self.rect = rect

    def set_background(self):
        background = Surface(self.get_size())
        background.fill(self.parent.opaque_color)
        background.convert()
        self.background = background

    def set_x_range(self):
        max_seg = self.parent.segment_width_range[1]
        self.x_range = max_seg / 2, self.get_width() - max_seg / 2

    def generate_segments(self):
        self.segments = []
        self.leg = Leg(self)
        y = self.get_height()
        while y > 0:
            self.add_segment(y)
            y -= self.segments[0].rect.h

    def add_segment(self, bottom=None):
        leg = self.leg
        segments = self.segments
        if leg.is_complete():
            leg = Leg(self)
        if bottom is None:
            bottom = segments[0].rect.top
        x = segments[0].rect.centerx if segments else 0
        segments.insert(0, Segment(self, leg, bottom, x))
        leg.advance()
        self.leg = leg

    def update(self):
        self.set_clip()
        self.clear()
        self.update_segments()
        self.draw()

    def set_clip(self):
        parent = self.parent
        y = parent.get_clip().top - parent.padding[0] - parent.parent.bandit.rect.h
        Surface.set_clip(self, Rect((0, y), parent.get_clip().size))

    def clear(self):
        self.blit(self.background, (0, 0))

    def update_segments(self):
        if self.segments[0].rect.top >= -self.parent.segment_height_range[1]:
            self.add_segment()
        for segment in self.segments:
            if segment.rect.top > self.get_height():
                self.segments.remove(segment)
            else:
                segment.update()

    def draw(self):
        self.parent.blit(self, self.rect)


class Leg:

    dirs = [-1, 1]

    def __init__(self, road):
        self.road = road
        self.length = randint(*road.parent.leg_range)
        self.direction = self.dirs[randint(0, len(self.dirs) - 1)]
        self.index = 0

    def advance(self):
        self.index += 1
        self.shift = randint(*self.road.parent.shift_range) * self.direction

    def change_direction(self):
        dirs = self.dirs
        direction = self.direction
        if direction == dirs[0]:
            direction = dirs[1]
        else:
            direction = dirs[0]
        self.direction = direction

    def is_complete(self):
        return self.index >= self.length
from operator import sub
from random import randint

from pygame import Surface, Rect, Color, transform, draw

from esp_hadouken.GameChild import *

class Segment(GameChild):

    def __init__(self, parent, leg, bottom, x):
        GameChild.__init__(self, parent)
        self.init_rect(leg, bottom, x)
        self.color = parent.parent.transparent_color

    def init_rect(self, leg, bottom, x):
        parent = self.parent
        rect = Rect(0, 0, 0, randint(*parent.parent.segment_height_range))
        x_range = parent.x_range
        if x is None:
            x = randint(*x_range)
        else:
            x += leg.direction * randint(*parent.parent.shift_range)
        if x < x_range[0] or x > x_range[1]:
            leg.change_direction()
            if x < x_range[0]:
                x = x_range[0]
            else:
                x = x_range[1]
        rect.centerx = x
        rect.bottom = bottom
        self.rect = rect

    def update(self):
        self.update_width()
        self.recenter()
        self.scroll()
        self.draw()

    def update_width(self):
        parent = self.parent
        rect = self.rect
        pos = float(rect.bottom) / parent.get_height()
        centerx = rect.centerx
        width_r = parent.parent.segment_width_range
        rect.w = pos * -sub(*width_r) + width_r[0]
        rect.centerx = centerx

    def recenter(self):
        rect = self.rect
        right_bound = self.parent.get_width()
        if rect.left < 0:
            rect.left = 0
        elif rect.right > right_bound:
            rect.right = right_bound

    def scroll(self):
        self.rect.top += self.parent.parent.scroll_speed

    def draw(self):
        draw.rect(self.parent, self.color, self.rect)
from random import randint

from pygame import Surface, Color

from esp_hadouken.levels.Void import *
from Barrier import *

class Gauntlet(Void):

    step_count = 0

    def __init__(self, parent):
        Void.__init__(self, parent)
        self.read_configuration()
        self.set_area()
        self.generate_barriers()

    def read_configuration(self):
        config = self.get_configuration()
        prefix = "horse-level-"
        self.padding = config[prefix + "void-padding"]
        self.size_range = config[prefix + "size-range"]
        self.step_limit = config[prefix + "step-limit"]

    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

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

    def generate_barriers(self):
        self.barriers = barriers = []
        y = 0
        while y < self.area.get_height():
            sibling = None if not barriers else barriers[-1]
            barriers.append(Barrier(self, y, sibling))
            y += barriers[-1].get_height()

    def update_area(self):
        self.update_step_count()
        self.clear_area()
        self.update_barriers()
        self.draw_area()

    def update_step_count(self):
        count = self.step_count + 1
        if count > self.step_limit:
            count = 0
            self.toggle_barrier_headings()
        self.step_count = count

    def toggle_barrier_headings(self):
        for barrier in self.barriers:
            barrier.toggle_heading()

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

    def update_barriers(self):
        for barrier in self.barriers:
            barrier.update()

    def draw_area(self):
        self.blit(self.area, (0, self.y_range[0]))
3.234.210.25
3.234.210.25
3.234.210.25
 
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.