Play

Support up-and-coming indie game developers by playing their games. Leave a comment to tell them what you like or what can be improved.

Learn

Our tutorials go from basic Processing through advanced libGDX.

Code

Free hosting for Processing, Java, libGDX, and JavaScript games.

Blog

Read about what we're up to, or write your own blog to keep us updated on your latest projects.

Forum

Stuck on a code problem? Just want to talk? Come say hi!

Open Source

Static Void Games is completely open-source. Want to practice your web development skill? Contribute on GitHub!

Newest games:

Recent happenings:

Kevin's latest blog: Twitter Bots and Golden Spirals

The other day, I came across this ridiculous twitter account (thanks @iandioch), which tweeted out this ridiculous picture:

Tails Golden Spiral

That picture made me laugh out loud, probably more than it should have.

The golden spiral can be seen in everything from nature to photography to galaxy formations. It's interesting to think about, but it also gets applied to tons of stuff that is probably just coincidental.

So, the haphazardly applied golden spiral overlaid on top of Miles "Tails" Prower seems to point out the absurdity of trying to recognize patterns where there are none... or it's just a silly picture. Either way, I thought it was hilarious.

And because of the way my brain works, my first thought was "this would make a great twitter bot."

So I made a twitter bot. The bot finds a random picture, adds a golden spiral to it (technically, a Fibonacci spiral), and tweets that out. You can check it out here: @GoldenSpiralBot

I've never messed with Twitter's API before, so it was pretty fun to see how easy it was to get started. I've created a tutorial (and another twitter bot) if you're curious about creating your own twitter bot: How to Make a Twitter Bot in Java

The GoldenSpiralBot is pretty much exactly what I had in mind, mostly tweeting out ridiculous pictures that don't make sense:

golden spiral eagle

hedgehog golden spiral

And occasionally seemingly getting it right:

galaxy golden spiral

chipmunk golden spiral

But, it's all random! That's still hilarious to me- look, I don't get out much, okay?

The hardest part of this whole process was getting the golden spiral generator (I called it the "spiralizer") to work. I started out trying to draw the spiral from the outside, but ended up rewriting it to start from the inside. I ended up with a recursive algorithm that uses the Fibonacci sequence to draw a golden spiral... all to tweet out ridiculous pictures. Worth it!

For the curious, the process of the bot goes something like this:

  • Find a random tweet that contains an image
  • Download that image
  • Use the BufferedImage and Graphics2D classes to draw a golden spiral on it
  • Upload that image along with a tweet
  • Sleep for an hour, then do it all again!

One of the obnoxious problems I'm fighting is, well, it turns out there's a LOT of porn spam on twitter. I'm just grabbing a random picture from the internet, which turns out to be... pretty gross. I've been playing with different filters to try to avoid it, but holy cow. My twitter bot ends up spiralizing porn that other twitter bots are tweeting out as spam... which would almost be futuristic if it wasn't so... yucky.

Anyway, if you want to make your own twitter bot, check out the tutorial I just wrote. If you want to see some bots in action, follow @GoldenSpiralBot or @WrongYourBot!

Okay now I'm going to get back to work making the site prettier, I promise. (Unless I stumble upon another random project that sounds more fun that tweaking css... oh look a squirrel!)

Advertisement
Static Void Games is open-source!