I’ve been spending the last few days on some rather interesting ActionScript challenges. I’ve been building a sort of a lava lamp gloopy movement machine. I’ve been up to my neck in physics and trigonometry, so today when I had to change the way that the mouse moves objects around in the “gloop”, I got too carried away with triangles and tangents before coming home to think, and realising how simple it ought to be. Here’s some fun code, paste it into any MovieClip in Flash: put it on the first frame and then on the last frame, add a simple gotoAndPlay(2) so that the initialisation doesn’t take place twice. Or turn it into a proper object: this is just my quick & dirty version:
reach = 250; // radius of the "force field" around the mouse (pixels)
strength = 10; // strength of the mouse effect, 1-100
speedx = Math.random() * 3; // initial x speed
speedy = Math.random() * 3; // inital y speed
this.onEnterFrame = function ()
{
_x += speedx;
_y += speedy;
if (_x < 0 || _x > Stage.width)
{
speedx = -speedx;
}
if (_y < 0 || _y > Stage.height)
{
speedy = -speedy;
}
distance = Math.sqrt(Math.pow (_xmouse, 2) + Math.pow (_ymouse, 2));
if (power > 0)
{
updateSpeed();
}
power = Math.max (0, reach - distance) / reach;
oldX = _xmouse;
oldY = _ymouse;
}
function updateSpeed()
{
speedx += (_xmouse - oldX) * power * strength/100;
speedy += (_ymouse - oldY) * power * strength/100;
}
You should be able to drag the object around the screen, and throw it off in different directions. Try playing with the range and strength variables for different effects.
Over the Christmas and New Yea period, I’ve been listening to a lot of Resonance FM via Windows Vista’s UK Radio Sidebar. Heard some wonderful shows, but it’s all been very perplexing. Being a bit of an email junky, I find myself drawn to my PC several times a day, and I usually end up sitting in front of it for far longer than I’d intended, and firing up the radio player to occupy me.
Over Christmas, Resonance have been filling entire days with multiple episode of a single programme. The odd thing is, whenever I switch on the radio player on any given day, nine times out of ten I arrive at exactly the same point of the same show, to within a few seconds, as I did when I last tuned in. The effect can be quite surreal. Last week I switched on the radio four times over the course of a day, and each time heard the phrase “our guest today is the writer Howard Jacobson”. At first it was quite charming, but the novelty is wearing off. Bizarre serendipity, software glitch, or the result of some hidden pattern within my email-collecting/radio listening habit? Perhaps I’ll never know.
Still on the subject of radio, please check out my Christmas family radio show (if you haven’t already): on Christmas day I dragged Gill, Rowan and Lola into the SheffieldLive! studio with me, made them choose some choons, the girls opened presents, Gill and I chatted away, and my extended family got in on the act via the SheffieldLive! chatroom. It was the most fun it’s possibly to have on Christmas morning without involving a team of reindeer, and you can “listen again” here.
Some of my more observant friends have noticed that I’ve hardly uploaded any photos in the last few months. My last set on Danshotme dates from early October, and I’ve only posted half-a-dozen or so pics to Flickr since then.
I have been going through one of those “fallow periods” which will be familiar to all photographers. Of course, whereas in the past a fallow period meant not touching my camera for six months, now it means that I average only one hundred or so photos per week, rather than the usual couple of thousand. And I’ve had neither the time nor the inclination to do much with those photos.
The advantage of this is that, when I finally get around to looking at the pictures taken over this period, they often surprise me with their freshness, because I have had time to forget what they look like. The disadvantage is that I’ll probably never get around to editing them, because it just seems like too big a task.
Anyway, a few of my regular readers (and it seems that I do have them) have been clamouring for more photos. And I’ve sort of been itching to upload some myself. So I have produced a few new sets, but I still haven’t had time to sift and edit them. So these are rather large sets, of photos without any kind of retouching or colour/exposure correction. With those provisos in mind, please enjoy:
Latest Comments
Sandyman, jump., lala la, lala la, ( Y ) BUMBUM, ()(), maaat!, Tom Garvey, Tom Garvey, Louice [...]
Mario Alvarez, iean, rancidjack, YourPC, Igor, A, Richard, joseph, Chris, Leeb [...]
jonny, Dan Sumption, abba
Dave, Frank Sumption
Bill Nixon, bk
homo, , , Goose, DICK BOY