from lib.pgfw.pgfw.Sprite import Sprite

class Blinker(Sprite):

    def __init__(self, parent):
        Sprite.__init__(self, parent)
        self.set_frames()

    def set_frames(self):
        pass
from lib.pgfw.pgfw.Animation import Animation

class Drop(Animation):

    def __init__(self, parent):
        Animation.__init__(self, parent)
from lib.pgfw.pgfw.Animation import Animation
from food_spring.level.drop.Blob import Blob

class Drops(Animation):

    def __init__(self, parent, horizontal=False):
        Animation.__init__(self, parent)
        self.horizontal = horizontal
        self.display_surface = self.get_display_surface()
        self.load_configuration()
        self.guns = self.parent.guns
        self.blob = Blob(self)
        self.reset()
        self.register(self.spawn, self.send_gun)

    def load_configuration(self):
        config = self.get_configuration("drop")
        self.first_spawn = config["first-spawn"]
        self.spawn_decrease = config["spawn-decrease"]
        self.speed = config["speed"]
        self.blob_length = config["blob-length"]
        self.consecutive = config["consecutive"]

    def reset(self):
        self.started = False
        self.spawn_delay = self.first_spawn
        self.count = 0
        self.return_to_origin()
        self.guns.reset()
        self.blob.hide()
        self.halt()

    def return_to_origin(self):
        self.y = 0

    def update(self):
        if self.parent.is_going():
            if not self.started:
                self.play(self.spawn, delay=self.spawn_delay, play_once=True)
                self.started = True
            Animation.update(self)
            self.blob.update()

    def spawn(self):
        self.blob.show()
        self.play(self.send_gun, delay=self.blob_length)

    def send_gun(self):
        guns = self.guns
        visible_gun_index = min(len(guns) - 1, self.count / self.consecutive)
        if guns[visible_gun_index].location.colliderect(self.parent.food):
            self.count += 1
            self.return_to_origin()
            guns[visible_gun_index].location.bottom = self.y
            guns.hide()
            self.spawn_delay *= self.spawn_decrease
            self.play(self.spawn, delay=self.spawn_delay, play_once=True)
            self.halt(self.send_gun)
            self.parent.siphon.add(visible_gun_index)
        else:
            self.blob.hide()
            guns.hide(visible_gun_index)
            gun = guns[visible_gun_index]
            gun.location.bottom = self.y
            gun.follow(self.parent.food)
            self.y += self.speed
from distutils.core import setup

setup(name="Pygame Framework",
      version="0.1",
      description="Classes to facilitate the creation of pygame projects",
      author="Frank DeMarco",
      author_email="frank.s.demarco@gmail.com",
      url="http://usethematrixze.us",
      packages=["pgfw"],
      classifiers=["Development Status :: 2 - Pre-Alpha",
                  "Environment :: Plugins",
                  "Intended Audience :: Developers",
                  "License :: Public Domain",
                  "Programming Language :: Python :: 2.7"])
from time import sleep
from random import randint

from pgfw.Game import Game

# inheriting from Game allows you to customize your project
class SampleGame(Game):

    square_width = 30

    # update runs every frame, you can think of it as the mainloop
    def update(self):
        sleep(1)
        screen = self.get_screen()
        bounds = screen.get_size()
        screen.fill((0, 0, 0))
        screen.fill((255, 255, 255),
                    (randint(0, bounds[0]), randint(0, bounds[1]),
                     self.square_width, self.square_width))


if __name__ == '__main__':
    # the play method begins the project's animation
    SampleGame().play()
from time import time as get_secs

from pygame import joystick as joy
from pygame.key import get_pressed
from pygame.locals import *

from GameChild import *

class Input(GameChild):

    def __init__(self, game):
        GameChild.__init__(self, game)
        self.last_mouse_down_left = None
        self.joystick = Joystick()
        self.delegate = self.get_delegate()
        self.load_configuration()
        self.set_any_press_ignore_list()
        self.unsuppress()
        self.subscribe_to_events()
        self.build_key_map()
        self.build_joy_button_map()

    def load_configuration(self):
        self.release_suffix = self.get_configuration("input", "release-suffix")
        self.key_commands = self.get_configuration().items("keys")
        self.double_click_time_limit = self.get_configuration(
            "mouse", "double-click-time-limit")

    def set_any_press_ignore_list(self):
        self.any_press_ignored = set(["capture-screen", "toggle-fullscreen",
                                      "reset-game", "record-video", "quit",
                                      "mute", "toggle-interpolator"])
        self.any_press_ignored_keys = set()

    def unsuppress(self):
        self.suppressed = False

    def subscribe_to_events(self):
        self.subscribe(self.translate_key, KEYDOWN)
        self.subscribe(self.translate_key, KEYUP)
        self.subscribe(self.translate_joy_button, JOYBUTTONDOWN)
        self.subscribe(self.translate_joy_button, JOYBUTTONUP)
        self.subscribe(self.translate_axis_motion, JOYAXISMOTION)
        self.subscribe(self.translate_mouse_input, MOUSEBUTTONDOWN)
        self.subscribe(self.translate_mouse_input, MOUSEBUTTONUP)

    def build_key_map(self):
        key_map = {}
        for command, keys in self.key_commands:
            key_map[command] = []
            if type(keys) == str:
                keys = [keys]
            for key in keys:
                key_map[command].append(globals()[key])
        self.key_map = key_map

    def build_joy_button_map(self):
        self.joy_button_map = self.get_configuration("joy")

    def suppress(self):
        self.suppressed = True

    def translate_key(self, event):
        if not self.suppressed:
            cancel = event.type == KEYUP
            posted = None
            key = event.key
            for cmd, keys in self.key_map.iteritems():
                if key in keys:
                    self.post_command(cmd, cancel=cancel)
                    posted = cmd
            if (not posted or posted not in self.any_press_ignored) and \
                   key not in self.any_press_ignored_keys:
                self.post_any_command(key, cancel)

    def post_command(self, cmd, **attributes):
        self.delegate.post(cmd, **attributes)

    def post_any_command(self, id, cancel=False):
        self.post_command("any", id=id, cancel=cancel)

    def translate_joy_button(self, event):
        if not self.suppressed:
            cancel = event.type == JOYBUTTONUP
            posted = None
            for command, button in self.joy_button_map.iteritems():
                if int(button) == event.button:
                    self.post_command(command, cancel=cancel)
                    posted = command
            if not posted or posted not in self.any_press_ignored:
                self.post_any_command(event.button, cancel)

    def translate_axis_motion(self, event):
        if not self.suppressed:
            axis = event.axis
            value = event.value
            if -.01 < value < .01:
                for command in "up", "right", "down", "left":
                    self.post_command(command, cancel=True)
                    if command not in self.any_press_ignored:
                        self.post_any_command(command, True)
            else:
                if axis == 1:
                    if value < 0:
                        command = "up"
                    elif value > 0:
                        command = "down"
                else:
                    if value > 0:
                        command = "right"
                    elif value < 0:
                        command = "left"
                self.post_command(command)
                if command not in self.any_press_ignored:
                    self.post_any_command(command)

    def is_command_active(self, command):
        if not self.suppressed:
            if self.is_key_pressed(command):
                return True
            joystick = self.joystick
            joy_map = self.joy_button_map
            if command in joy_map and joystick.get_button(joy_map[command]):
                return True
            if command == "up":
                return joystick.is_direction_pressed(Joystick.up)
            elif command == "right":
                return joystick.is_direction_pressed(Joystick.right)
            elif command == "down":
                return joystick.is_direction_pressed(Joystick.down)
            elif command == "left":
                return joystick.is_direction_pressed(Joystick.left)

    def is_key_pressed(self, command):
        poll = get_pressed()
        for key in self.key_map[command]:
            if poll[key]:
                return True

    def translate_mouse_input(self, event):
        button = event.button
        pos = event.pos
        post = self.post_command
        if event.type == MOUSEBUTTONDOWN:
            if button == 1:
                last = self.last_mouse_down_left
                if last:
                    limit = self.double_click_time_limit
                    if get_secs() - last < limit:
                        post("mouse-double-click-left", pos=pos)
                last = get_secs()
                self.last_mouse_down_left = last

    def get_axes(self):
        axes = {}
        for direction in "up", "right", "down", "left":
            axes[direction] = self.is_command_active(direction)
        return axes

    def register_any_press_ignore(self, *args, **attributes):
        self.any_press_ignored.update(args)
        self.any_press_ignored_keys.update(self.extract_keys(attributes))

    def extract_keys(self, attributes):
        keys = []
        if "keys" in attributes:
            keys = attributes["keys"]
            if type(keys) == int:
                keys = [keys]
        return keys

    def unregister_any_press_ignore(self, *args, **attributes):
        self.any_press_ignored.difference_update(args)
        self.any_press_ignored_keys.difference_update(
            self.extract_keys(attributes))


class Joystick:

    (up, right, down, left) = range(4)

    def __init__(self):
        js = None
        if joy.get_count() > 0:
            js = joy.Joystick(0)
            js.init()
        self.js = js

    def is_direction_pressed(self, direction):
        js = self.js
        if not js or direction > 4:
            return False
        if direction == 0:
            return js.get_axis(1) < 0
        elif direction == 1:
            return js.get_axis(0) > 0
        elif direction == 2:
            return js.get_axis(1) > 0
        elif direction == 3:
            return js.get_axis(0) < 0

    def get_button(self, id):
	if self.js:
	    return self.js.get_button(id)
18.227.228.95
18.227.228.95
18.227.228.95
 
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.

March 3, 2021

Video 📺

Computers are a gun. They can see the target; they can pull the trigger. Computers were made by the military to blow people's brains out if they stepped out of line. Google Coral is the same technology that pollutes the oceans, and so is the computer I'm using, and so are the platforms I'm using to post this.

Game 🎲

Games are a context in which all play is purposeful. Games expose the fundamentally nihilistic nature of the universe and futility of pursuing any path other than the inevitability of death and the torture of an evil that knows and exploits absolute freedom. Games are not educational; they are education.

Propaganda 🆒

Education is propaganda — ego driven by-product conveying nothing that would enable us to expose that vanities made for gain subject us further to an illusion created by those in control: the illusion that quantity can represent substance and that data or observation can replace meaning. And why say it, or how, without contradicting yourself, that everything, once registered, no longer exists, and in fact never did, exists only in relation to other non-existent things, and when you look, it's not there, not only because it's long vanished, but because where would it be?


fig. 2: Gamer goo is a lubricant — not for your skin, but for facilitating your ability to own the competition (image from Gamer goo review)

As a result of video games, the great Trojan horse 🎠 of imperialist consumerist representationalism, people are divided in halves to encourage them to act according to market ordained impulses, to feign assurance, penetrating themselves deeper into a tyranny from which every action signals allegiance, confusing the world with definitions and borders, constantly struggling to balance or brace themselves against forces that threaten the crumbling stability of their ego.

F

or example, a cup 🥃 is designed and built to hold something, maintain order and prevent chaos. It keeps water from spilling back to where it belongs, back where it wants to go and gravity wants it to go. The cup is a trap, and it is used to assert dominance over nature, to fill with thoughts about existence, time and self, thoughts regarding dissimilarity between equal parts and patterns that manifest in variation. These ruminations disguised as revelations boil away to reveal isolated and self-aggrandizing thoughts about an analogy fabricated to herald the profundity of one's campaign's propaganda. You have no authentic impulse except to feed a delusion of ultimate and final supremacy. That is why you play games. That is your nature. That is why you eventually smash the cup to bits 💥 or otherwise watch it disintegrate forever because it, by being useful, threatens your facade of ownership and control.


fig. 3: worth1000

The cup is you; it reflects you; it is a lens through which you see yourself; it reassures you, confirming your presence; it says something, being something you can observe. When you move, it moves, and it opens after being closed. You can use it as a vessel for penetration fantasies, keeping you warm and fertile, a fine host for the plague of consciousness, you reptile, you sun scorched transgressor that not only bites the hand that feeds, but buries it deep within a sterile chamber where nothing remains for it as a means of escape except the corpses of others that infringed upon your feeding frenzy.

January 23, 2021

I wanted to document this chat-controlled robot I made for Babycastles' LOLCAM📸 that accepts a predefined set of commands like a character in an RPG party 〰 commands like walk, spin, bash, drill. It can also understand donut, worm, ring, wheels, and more. The signal for each command is transmitted as a 24-bit value over infrared using two Arduinos, one with an infrared LED, and the other with an infrared receiver. I built the transmitter circuit, and the receiver was built into the board that came with the mBot robot kit. The infrared library IRLib2 was used to transmit and receive the data as a 24-bit value.


fig. 1.1: the LEDs don't have much to do with this post!

I wanted to control the robot the way the infrared remote that came with the mBot controlled it, but the difference would be that since we would be getting input from the computer, it would be like having a remote with an unlimited amount of buttons. The way the remote works is each button press sends a 24-bit value to the robot over infrared. Inspired by Game Boy Advance registers and tracker commands, I started thinking that if we packed multiple parameters into the 24 bits, it would allow a custom move to be sent each time, so I wrote transmitter and receiver code to process commands that looked like this:

bit
name
description
00
time
multiply by 64 to get duration of command in ms
01
02
03
04
left
multiply by 16 to get left motor power
05
06
07
08
right
multiply by 16 to get right motor power
09
10
11
12
left sign
0 = left wheel backward, 1 = left wheel forward
13
right sign
0 = right wheel forward, 1 = right wheel backward
14
robot id
0 = send to player one, 1 = send to player two
15
flip
negate motor signs when repeating command
16
repeats
number of times to repeat command
17
18
19
delay
multiply by 128 to get time between repeats in ms
20
21
22
23
swap
swap the motor power values on repeat
fig 1.2: tightly stuffed bits

The first command I was able to send with this method that seemed interesting was one that made the mBot do a wheelie.

$ ./send_command.py 15 12 15 1 0 0 0 7 0 1
sending 0xff871fcf...


fig 1.3: sick wheels

A side effect of sending the signal this way is any button on any infrared remote will cause the robot to do something. The star command was actually reverse engineered from looking at the code a random remote button sent. For the robot's debut, it ended up with 15 preset commands (that number is in stonks 📈). I posted a highlights video on social media of how the chat controls turned out.

This idea was inspired by a remote frog tank LED project I made for Ribbit's Frog World which had a similar concept: press a button, and in a remote location where 🐸 and 🐠 live, an LED would turn on.


fig 2.1: saying hi to froggo remotely using an LED

😇 The transmitter and receiver Arduino programs are available to be copied and modified 😇

March 22, 2020

The chicken nugget business starter kit is now available online! Send me any amount of money through Venmo or PayPal, and I will mail you a package which will enable you to start a chicken nugget business of your own, play a video game any time you want, introduce a new character into your Animal Crossing village, and start collecting the chicken nugget trading cards.

The kit includes:

  • jellybean
  • instruction manual
  • limited edition trading card

By following the instructions you'll learn how to cook your own chicken or tofu nugget and be well on your way to financial success. I'm also throwing in one randomly selected card from the limited edition trading card set. Collect them, trade them, and if you get all eighteen and show me your set, I will give you an exclusive video game product.

All orders are processed within a day, so you can have your kit on your doorstep as quickly as possible. Don't sleep on this offer! Click the PayPal button or send a Venmo payment of any amount to @ohsqueezy, and in a matter of days you'll be counting money and playing video games.

PayPal me

June 23, 2019

is pikachu dead

yes and how about that for a brain tickler that what you're seeing all along was a ghost. we used a digital stream of bits that in the future we call blood to recreate everything as a malleable substance that is projected through computers over a massive interstellar network that runs faster than the speed of light in order to simultaneously exist at every moment in time exactly the same way effectively creating a new dimension through which you can experience the timeless joy of video games. you can press a button and watch the impact of your actions instantaneously resonate eternally across an infinite landscape as you the master of a constantly regenerating universe supplant your reality with your imagination giving profoundly new meaning to the phrase what goes around comes around as what comes around is the manifestation of the thoughts you had before you were aware of them. thoughts before they were thought and actions before they were done! it's so revolutionary we saved it for 10,000 years from now but it's all recycled here in the past with you at the helm and the future at the tips of your fingers

June 7, 2018

May 17, 2018

Line Wobbler Advance is a demake of Line Wobbler for Game Boy Advance that started as a demo for Synchrony. It contains remakes of the original Line Wobbler levels and adds a challenging advance mode with levels made by various designers.


f1. Wobble at home or on-the-go with Line Wobbler Advance

This project was originally meant to be a port of Line Wobbler and kind of a joke (demaking a game made for even lower level hardware), but once the original levels were complete, a few elements were added, including a timer, different line styles and new core mechanics, such as reactive A.I.


f2. Notes on Line Wobbler

I reverse engineered the game by mapping the LED strip on paper and taking notes on each level. Many elements of the game are perfectly translated, such as enemy and lava positions and speeds and the sizes of the streams. The boss spawns enemies at precisely the same rate in both versions. Thanks in part to this effort, Line Wobbler Advance was awarded first prize in the Wild category at Synchrony.


f3. First prize at Synchrony

Advance mode is a series of levels by different designers implementing their visions of the Line Wobbler universe. This is the part of the game that got the most attention. It turned into a twitchy gauntlet filled with variations on the core mechanics, cinematic interludes and new elements, such as enemies that react to the character's movements. Most of the levels are much harder than the originals and require a lot of retries.

Thanks Robin Baumgarten for giving permission to make custom levels and share this project, and thanks to the advance mode designers Prashast Thapan, Charles Huang, John Rhee, Lillyan Ling, GJ Lee, Emily Koonce, Yuxin Gao, Brian Chung, Paloma Dawkins, Gus Boehling, Dennis Carr, Shuichi Aizawa, Blake Andrews and mushbuh!

DOWNLOAD ROM
You will need an emulator to play. Try Mednafen (Windows/Linux) or Boycott Advance (OS X)

July 19, 2017


f1. BOSS

Games are corrupt dissolutions of nature modeled on prison, ordering a census from the shadows of a vile casino, splintered into shattered glass, pushing symbols, rusted, stale, charred, ultraviolet harbingers of consumption and violence, badges without merit that host a disease of destruction and decay.

You are trapped. You are so trapped your only recourse of action is to imagine an escape route and deny your existence so fully that your dream world becomes the only reality you know. You are fleeing deeper and deeper into a chasm of self-delusion.

While you're dragging your listless, distending corpus from one cell to another, amassing rewards, upgrades, bonuses, achievements, prizes, add-ons and status boosts in rapid succession, stop to think about what's inside the boxes because each one contains a vacuous, soul-sucking nightmare.

Playing can be an awful experience that spirals one into a void of harm and chaos, one so bad it creates a cycle between the greater and lesser systems, each breaking the other's rules. One may succeed by acting in a way that ruins the world.

May 20, 2013

Welcome! I will be posting here about open-source games and music I am making for free online distribution. Most recently, I made Ball & Cup for Ludum Dare 26, a game I will work on more in June. After finishing, if it's fun, I will build an arcade cabinet for it! Next week, I am joining the 7-Day Fishing Jam to develop an A-life prototype about searching a cloud of noise for organisms.

Before Ball & Cup, I was adding features like vehicle engines, new graphics and effects and detailed scoring to an updated version of E.S.P. Hadouken, currently a prototype about navigating five psychic hadoukens to save your Game Boy. The new version will be similar with a clearer story and more ways to judge your performance. I plan on finishing it after making a public version of Ball & Cup.

I will also upload some digital albums soon. One, Man's Womb, is a solo collection of chiptunes from Emoticon Vs. Rainbow, an online racing/rhythm game. The other, Tor Ghul/Spin Ghul is a guitar and synth record recorded with my friends last summer. The recording and sequencing are finished for both -- I just have to make their web pages and artwork and package them for downloading.

Later, I hope to write about games in their early stages, an abstract action-RPG called Panopticon: Swarm, a massively multiplayer exploration, voting, post-catastrophic city simulation, Vomit Inspector and a mobile mini-game compilation project that includes an external digital pet raising and social networking mode. I also plan to post analyses of games I'm playing as a design exercise and for fun.

I will write about more game stuff like arcade trips, game jams and electronics! Plus whatever I haven't thought of! If you use RSS, subscribe to my feed!