LaserQuest!! Pew Pew Pew

Dan from Seed Software organised a bit of shooting fun tonight. And so a bunch of us turned up at LaserQuest in Hull. Some of us were dressed in black, which I thought was a good idea, until I discovered just how much it makes your dandruff stand out when they turn up the UV light. And from the look of everyone’s teeth it looked like we now all lived on the far side of the uncanny valley. Of course, I took the camera, although I didn’t use the flash and had to set the sensitivity to a very silly value.

4286388744

I think you should know that I got shot several times while taking this picture.

4285652523

One of the few remaining pictures of “The Outfit”

4286386398

Into the fray

4285649917

Peter uses a laser to lay down the law

4285679973

Ha. Go Red Team. And I wasn’t the worst one there either…

Adding Images to Flash Programs using FlashDevelop

Images make programs more fun. And in the Flash world, it is all about images. There are essentially two places that your images can come from. You can get them from the internets or you can load them from your Flash project. I've been trying to do both, and finally I've figured out how to do this reliably using the FlashDevelop tool.

Mostly.

Today I'm going to look at loading images from your library, the one that should be the easiest to do. These notes apply to FlashDevelop 3.0.6 which you can find here. I’ve found this stuff out while playing with my Chumby, but you can use the techniques for any flash program.

Say I have an image called “one.png” that I want to add to my project. It just contains the number one:

one

First thing I do, is add it to the library directory in my project:

image

It is now in there, along with the font that I’m using to display messages. Note that it is displayed in black though. This is bad, in that it means that it is not part of my project. Attempts to load it won’t work. To make it part of the project I need to right click on it and select “Add to Library” from the context menu that pops up:

image

Now the item in the project turns blue, which is good  because it means it has an outside chance of working. Next thing i want to do is load the image into a media clip.  I can do this in the Main method of the application class if I like:

static function main(mc:MovieClip)
{   

    var oneImage:MovieClip;
    oneImage = mc.attachMovie("library.one.png", 
                 "oneImage",
                 mc.getNextHighestDepth());
}

The first parameter is the name of the file in the resource. Warning: the property information for a library item (the thing you can see above) has a useful appearing “Insert into document” tab, which will insert the path to your resource into your program. For my one image above it suggests the helpful path “libary/one.png”. This doesn’t work. You need to separate the directories in the path using dots, as I have in my sample code above. I’ve no idea why this doesn’t work, perhaps someone out there can tell me.

The second parameter is the name of the resource you are creating.

The third parameter is the draw depth. You can ask the parent movie clip to give you the next highest draw depth. If you set your new image to this depth it will appear on the screen. If you put this code into the main method of your program it will fetch and draw the item.

image

Good eh?

If you get any part of it wrong,  get the path wrong, forget to add the item to the library or anything, then it won’t work and you will not get an error. I hate this. The only thing you can do is add trace statements to see what your program is doing. these are printed out

trace(oneImage._url);

This will display the url of the file that has been loaded.

Mad World Shopping

4280799929

Three bags full

Did the shopping today. All on my own. I did have a list, but even so I’m very impressed with myself. Anyhoo, the supermarket was selling off Mad World for the Nintendo Wii for a very nominal sum and so I invested in a copy.

Note: I never buy a computer game. I invest in a copy. This makes it sound much less like a waste of money. Although, perhaps investing is a waste of money these days too .

Anyhoo, once I had got home and figured out which cupboard to put things in (Hint: Use the very cold cupboard with a light inside, I think it is called a fridge, for items like yoghurt and sausages) I had a go at the game.

It is very bloodthirsty, violent and foul mouthed. You play a participant in a warped TV gameshow who has a chainsaw for an arm.  The gameplay revolves around extreme violence where you use the chainsaw, road signs and just about anything else around to bloodily despatch people who are presumably very bad. At least I hope they are/were…..

When you go into chainsaw mode the Wii remote actually makes chainsaw noises. The game  is like being inside a slasher movie and has absolutely no moral centre. I quite like it.

Free XNA Screencasts

pebbles

I’ve been recording XNA screencasts for the last six months or so for Thirteen1 magazine. The aim is to give you a gentle introduction to programming, using XNA games as the basis of the teaching.

I’ve just reached the end of the first section. If you want to view the screencasts, and download the practical sessions that go with them, you can find them on VerySillyGames:

http://verysillygames.com/Screencasts

Christmas Chumby

4269183539

My “big” Christmas present to myself was a Chumby. This is a fun little internet appliance that you can write programs for.  I’ve started doing just that, and you can find out more at my newly minted Chumby pages.

Getting Started with Chumby

If you want to start writing applications (or widgets) for the Chumby device it helps if you know how to write Flash programs. At the start of this exercise I didn't, and so I had to spend some time in the learning curve.

If you are rich (and a graphics designer) you can simply shell out for a copy of the Adobe developer environment, that lets you create applications using timelines, and all kinds of things that can make things move around the screen. If you aren't rich (but are still a graphics designer) I can reccommend the products from SwishZone that seem to make animations that work, and don't cost that much.

However, I'm not rich. And I'm not a graphics designer, so I wanted to write programs that looked like programs. So instead I'm using FlashDevelop which lets me write programs that look sufficiently like C or C# that I feel mostly at home.

If you want to download the FlashDevelop project and source for my first ever release (Experiment 1: Slidy Clock) you can find it in the downloads part of my Chumby pages. I'll be releasing more experiments as I find out more about how to program this splendid little device.

Yet More Hull Imagine Cup Success

4259730206

Last snow picture for a while. actually taken on Friday on the way to fetch the Fish and Chips (note capitals) for tea.

The Imagine Cup is a programming competition run by Microsoft. We at Hull are quite good at taking part. Last Friday the six teams that have made it to the UK finals were announced, and two of them come from our university. Well done folks. We'll have team details and what they are up to later this month, when the students come back and we start up the new semester.

In the meantime, if you want to take part in the competition, do your bit for charity and cost Microsoft some money (and who doesn’t) you can still sign up for the other competitions at the UK Imagine Cup web site. Microsoft have pledged a pound to charity for everyone who gets involved.

Power Mad

4259702528

In Tesco yesterday I nearly bought one of these power monitor type things.  You strap a little sensor to your mains supply and a receiver box in the house gives you a second by second readout of how much your electricity is costing you. I was tempted, but in the end I didn’t invest. Not because I don’t think it is a good idea, but that I think in wrong hands (i.e. mine) such a thing would prove highly dangerous.

I know that as soon as I started getting live data from the device I’d turn into a power crazed madman, searching for hidden mains adapters and wincing whenever the kettle was turned on. I’d become obsessed with getting the thing to read zero pence at all times (which I know is impossible) and lie awake at night trying to work out where that thing which is costing me ten pence a day actually lurks.  I’d probably end up stressing about how much power the monitor itself consumes, and set up a treadmill somewhere which is attached to a generator.

I strongly agree with energy conservation, (that’s how come my loft is always so cold) and I’ve got loads of energy saving lamps all over the place.  Although (and I wonder if I’m the first person to notice this) when you turn on one of these fancy expensive bulbs they actually seem to make the room darker. I think this is because when they first come on the starter circuit gives a brief flash of bright light. This is then replaced by the dim glow produced by the tube itself which, if you are lucky and the bulb is less than a few months old, will eventually become bright enough to read by.

Anyhoo, in the light of all these things I’ve decided to give the energy monitor a miss for now. Perhaps in summer…

Bayonetta Review

4258929245

Hull in the snow

Bayonetta is bonkers. But great fun. I got a copy today and have spent a couple of hours playing it and I’m hooked. You play the role of the last surviving witch doing battles against avenging angels in a quest to  uncover your past . Or something. It is a third person fighting game with amazing special combat moves that defy explanation.

Bayonetta herself comes across as a kind of “Steam Punk Lara Croft on Acid” with a nice line in laconic dialog. You get your special moves by learning particular button combinations (or you go for the Easy mode where it figures out what button to press for you) and they let you do incredible things to your enemies, including lob them into torture chambers that you can conjure up out of thin air.

The action and the story zip along at quite a rate, and to be honest I’ve not got that much of an idea what is going on. However, I’ll keep playing to find out how it ends.

Help me lower my bounce rate

4256443016

I spent some time this lunch-hour playing with Google Analytics. I use it to track access to this site. I take a great interest in visitors here. In fact, even as you read this I’m actually looking at you. That’s me,  behind the third window along in the building above…..

Actually no, but every year or so I check on how the site is doing. I do have some readers (which is nice – thanks for coming) but I also have a “bounce rate” greater than 60%. Anything more than 20% is bad so they say. Of course, once I found this out I had to do something about it. The first thing I had to do was find out what “bounce rate” actually means.  It means the visitors that have been tracked as just arriving at the site, looking at one page and then disappearing.

From a business point of view this is probably not a good thing. It means that around two thirds of my visitors take one look at the place and then go no further. So, in order to make the Google machine happier, I ask you, dear reader, to stick around a bit more. Take a look at Trip Hazard. (New episode coming soon eventually). Discover the terrifying tale of  the Little Brown Ikea Pencil of Doom. Download some free software or a book. Even try to find some funny stuff from the archives.

How to be a Great Weather Forecaster

4207324854

In the time honoured tradition of “Shoot the messenger” I bring you my guide to weather prediction…

  1. Spend the first two thirds of the forecast talking about weather that has already happened. It is unlikely you will be particularly wrong about this bit.
  2. Say that the weather today will be about the same as yesterday. But use more words. Since this is the case around 60% of the time you are probably going to be more accurate than all the complicated computer programs presently being used.
  3. Make good use of “for the time of year”. Since nobody remembers what on earth that is, everyone will believe that what happens is what was supposed to happen.
  4. If something you didn’t predict happens make good use of “since records began”. This implies that nobody else has seen this happen and so you shouldn’t be expected to anticipate it either. Don’t make the mistake of adding that the records you are referring to are the notes you made on a napkin a week or so ago.
  5. Use words like “intermittent” and “scattered”, particularly in respect of things like rain and sunny periods. That way, if people don’t get that kind of weather where they are it can be rationalised as bad luck on their part.
  6. Use a higher pitched voice for good weather, with a rising inflection at the end of sentences. Use a lower pitched voice for bad weather, with a falling inflection at the end of sentences.  And stare straight at the camera for the really bad bits.
  7. Check out of the window before each forecast.

Snow Bored

4254483598

I’m getting bored with the snow. I’m also getting bored with every news report leading with the story of how bad the snow is. I don’t actually need to be told this. I can find out how cold and slippery it is just by going outside. 

I’ve been trying to find activities that warm me up. Here they are, with notes about there usefulness:

Marking Software Engineering coursework

Absolutely useless. There were not even any really bad designs that would make me boil with indignation.

Driving Home

While the car itself got toasty warm after a mile or so I spent the entire drive in a cold sweat wondering if I was the only person on the road aware we were driving on ice. By the way everyone drove so close to me I reckon I probably was.

Playing Uncharted

Useless.  Unless you count the effort involved in restraining myself from throwing the gamepad at the wall after being killed by one of those really nasty goblin type things that keep coming after me with crossbows.

Watching “The Red Dahlia: Above Suspicion” on ITV

Pretty useless. Certain amount of warming anger about the way that the master criminal was tracked down by the expert police team simply by having someone ring up and say “It was him!”. Otherwise no good for keeping warm.

Playing Wii Sports Table Tennis

Actually worked quite well. Even though I lost.

Windows 7 God Mode

The internets are alive at the moment with discussion of the newly discovered ‘God Mode” for Windows 7. To take part in the fun, create a folder with the name:

GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

The folder magically becomes a “one stop shop” for all the Windows 7 control panels. I don’t think it lets you do anything you couldn’t do before, but it does put lots of useful things in one place.

Back at Work

4247606036

Today is officially “The Most Depressing Day of the Year (tm)”, what with the end of the Christmas and New Year break and a long wait to Easter.  At least the office was nice and warm when I got to work. What better way to start the new year than with a big pile of marking….

Actually, I’ve found a good way to banish the start of years blues. Play Turn it Up by Pixie Lott very loud. Works a treat.

Avatar (and Sherlock Holmes) Film Review

4234816428

We went to see Avatar tonight. This was our third attempt to see the film. The first time we were snowed out, the second time it was full and we had to go and see Sherlock Homes instead.

Sherlock Homes is a blast. Just don’t go expecting to see anything which will stretch you intellectually (although it will stretch your credibility quite a lot). It has a lot in common with the Dan Brown novels. There are sinister cartels, strange goings on in high places and maps with lines drawn on them that point to the most obvious places - An attack on the Houses of Parliament? And not the whelk stall next door to it? How surprising.

Anyhoo, I found the Sherlock served up by Robert Downey Jr. much more fun than Robert Langton and Victorian London was very well realised.  If you have any pre-conceived ideas about Homes or Watson I suggest you leave them at the door though, along with a big chunk of your brain…

Avatar is a bit deeper. but only just. It was a story of  attempts by an evil company to subjugate the population of a planet made up entirely of scenes from old Yes and Ossibiza album covers (Note this is a very old reference, but if you are as old as me you can remember the art of Roger Dean). They - The Evil Company (tm)  that is – hire a crippled marine who is the genetically identical twin of his much more useful scientist brother, who was killed before the start of the film for reasons of plot.  Their Evil Plan (tm) is to gain the confidence of the natives and get intelligence by using a remote controlled Avatar which is bonded to our marine. Unfortunately (for the company) he goes native in a rather spectacular way, by falling for the Chief’s daughter (Who’d have thought?) and then things get explosively nasty.

The film is in 3D and this part works very well. At the start I was surprised by things that appeared to come out of the screen but by the end I was just watching a movie in 3D. And very impressive it was too.

As you would expect from a James Cameron film, the action sequences are great, but if you want deep philosophical content then you will have to look somewhere else. I think for me the most important aspect was the way that the computer generated elements were so well fused with the real actors and how the computer produced characters were both non-cartoonish and on the right side of the uncanny valley. Pretty soon we won’t need actors I reckon.