Area of Interest// programming

Creative Pact Day 2: CatFishTron

Creative Pact Day 2

Creative Pact Day 2

Today I’m going to create more of a “game,” eventually called CatFishTron.  No, really.  I’ll be learning how to add sound to a game, a moving background, and maybe, if I have time, add some self-removing sprites (for explosions, etc!)

First task – to make a sprite “blow-up” in AndEngine you use a SequenceModifier and attach it to the Sprite:

this.mBlowupModifier = new SequenceModifier(new ScaleModifier(1.0f, 1.0f, 0.2f));

final IShapeModifierListener listener = new IShapeModifierListener()
 {
 public void onModifierFinished(IShapeModifier arg0, IShape arg1)
 {
 // this is a function in my main Activity that removes a sprite entity and physics body in a separate thread
 destroySprite(_spriteEvent.mSprite);
 }
 };
 //set a listener to listen for the modification having finished
 this.mBlowupModifier.setShapeModifierListener(listener);
 // attach it to the sprite entity object
 _spriteEvent.mSprite.addShapeModifier(mBlowupModifier.clone());

Here’s today’s code (again, it’s not complete, just building on the previous day, but you might find it interesting…)

Here’s the app itself, you can open the link on your android phone to install it.

It’s a work in progress, remember. It take a bit to make a video game… even a crappy one!

Also, I promise that at the end of this I will write a tutorial.

Now go play MeowTron.

Marching Gloves Rocks and Code

Marching Rocks, Gloves & Code
Experimental electronica: new, old and somewhere in-between.

Saturday 24th October
7pm – Later. FREE

at SPACE, 129 – 131 Mare Street, London E8 3RH

SPACE and Culture Lab (Newcastle) come together to bring you an evening of experimental electronica, featuring performances from:  Jamie Allen’s CircuitMusic, Jo Kazuhiro, PixelH8, Massive Black Mountain (Will Schrimshaw & Nick J Williams), Adam Parkinson(Rare and Glorius) The Cane Toad Orchestra (OpenLab) and Dave Griffiths(Slub).

DJ RE:ROOT (Marc Garrett) from arts collective www.furtherfield.org provides punk, new wave, no wave, post punk and early electronica from 1976 – 1984 and Dean Baldwin’s “Minibar” the smallest bar in London will open its doors for one of the last times.

Tell your enemies, friends and family- this is going to be good.

More info at: http://www.spacestudios.org.uk/All_Content_Items/Media_Arts/MarchingRocksGloves&Code/

Pixelpusher and The Cane Toads at Shunt

The Cane Toads at Shunt 1 Oct 2009

The Cane Toads at Shunt 1 Oct 2009

The Cane Toad Orchestra featuring PixelPusher (or so I like to call it) is playing Shunt next Thursday, Oct 1, 2009, as part of Toplap’s Livecode stage.  That’s right, we’ll have no choice but to make some livecoded music and visuals, and that means sonic and visual anarchy of the most chill quality, kind of like a nice late-season muscat dessert wine, full of bite but thick with sweetness like a long summer day.  (I think that was a triple-simile, and I might have twisted my ankle landing that one.)

Noise Spears Processing Sketch

This is my suped-up version of the old flight404 and toxi Processing sketch – it uses Perlin noise to create a moving field of very organic-looking daggers.  toxi used it for hairs, and now I made an intricate version that uses 3D daggers drawn using OpenGL.

Noise Spears - PixelPusher (after toxi and flight404)

Noise Spears - PixelPusher (after toxi and flight404)

Read on for more plus source code

Creating a custom image gallery in wordpress using lightbox

I spent a bit of time trying to get lightbox working in WordPress with the new, built-in image gallery shorcode that is part of wordpress.

First, get Lightbox2 from its plug-in page.  Download it, unarchive it, and put the lightbox-2 folder into the plugins folder in your WordPress installation, and use the WordPress control panel to activate it, as per the instructions.

I had issues with thumbnails not being auto-generated – there are many solutions in this thread on the WordPress site, but after making sure that all of my images were standard 24-bit PNG it seemed to work very well.

Then, get my slightly-modified media.php file – what I did was to add the lightbox code to the default photo gallery shortcode function.  Rename the file to “media.php” and put it in your wp-includes folder in your wordpress installation.  You’ll probably want to keep your old media.php file before you do this – just rename the original one media.php.bak.

For the WP hackers out there, what I did was to simply cut the wp_get_attachment_link function from the file wp-includes/post-template.php and add it to media.php in place of the original function call.  then I modified that code to add the lightbox ref=”GALLERY_NAME” property to every image attachment link returned.

Once that is finished, you can upload images via the regular “add media” tool in the editor and display them via the gallery shortcode, and viola! They will be automatically open in a lightbox-enabled slide show.

UPDATE (for WP 2.6.5):

This no longer works, because they’ve changed media.php.  The new fix is to edit your wp-includes/media.php file so that starting from line 109 is the following:

		//$link = wp_get_attachment_link($id, $size, true);

        $pt = str_replace(" ", "_", $pt);
        $thumb = wp_get_attachment_image($id,
            $size='thumbnail', $icon = false); 

        $link= "<a href='". wp_get_attachment_url($id) .
            "' title='$post_title' rel='lightbox[$pt]'>$thumb</a>";

PopArt (a sketch)

PopArt Sketch 20080806

The first rule of blogging is to blog often.  So much for that. I’ve been traveling the world, and moving, and generally sans internet (that means “without internet” for all you non-French speakers).  In spite of this blog silence, I’ve been working on a lot of new things.  Like more experiments and sketches in Pop Art and Processing.   Here’s one (source code included):

PopArt 01

NYLON CityBlob

A software art project that remixes the skylines and sights of cities I’ve lived in and visited. Download at: NYLONCityBlob

NYLON CityBlob

Awhile back, in 2006, I put my lifelong obsession with New York City’s buildings to good use. 2006 was the year my wife and I moved to London to start a new life as expatriates, reversing the colonial journey that started our home country in favor of the old country on the edge of a new, powerful-again Europe.

Leaving New York, I felt like a traitor. New York is in my family’s blood. My grandfather loved nothing more than to take us around the sights – the Empire State, the Twin Towers, Macy’s, the countless delicatessens shining as culinary diamonds in the rough preserve of Mexicans making Chinese food and Chinese baking Pizzas. My grandfather spent all his years in New York, knew every inch of the serpentine BQE (Brooklyn-Queens-Expressway) slithering over and through industrial Brooklyn on its way up north to upstate and sweet oblivion, finally exploding into the Hutch, the Cross-Bronx, and the Bruckner.

Not that he would have ventured that far north – he hated grass, and crickets. Especially crickets.

I don’t want to give the impression that my family is parochial; they’re well-traveled and world-wise, but they always come back. I still haven’t returned.

I ‘ve turned my world travels into an art project – just as the skylines of all the places I’ve visited and lived get jumbled in my head over time, this software remixes them and rescales them and blends them into a chimera of a city. I’ll add to it over time but right now it is NY (New York City) LON (London). Sometimes it gets intimate, and small places crowd out the big, important, impersonal ones. Use the mouse to navigate. Mac-only (for now). Enjoy.

If you’d like to show it somewhere, please contact me at pixelpusher@flkr.com, I’m open to the idea.

offset circles take two

offset circles take two image
Originally uploaded by da mad pixelist on flkr

I’ve been playing with the offsetcircles patch from before, and came up with a whole bunch of nice results. Taking a page from Claude, I made the drawing recursive (hmm… makes me want to use Scheme…) and rendered out these two short videos. These are fun experiments in basic, rotary motion. Its really amazing what fun you can have with simple math, rotations, and some blending.

There’s also this one.

Here’s the actual sketch plus code (the last version, anyway):