Wednesday, August 5, 2009

Garish jodericity


Arrow keys for movement, spacebar to jump. Use arrow keys while swinging to increase his spin. Hold down spacebar to make the jump last longer. Hit spacebar again when holding on to a wall to wall jump. Click on the game to start interacting with it


Yup, I've done it. It's jodersome.

You all thought I was slacking off, didn't you? You thought I was just playing loads of GTA4 and looking at internet porn. Though I did do some of those things, I actually spent a lot of my time slaving away, finding out just how awfully orange and purple clash.

So now we have a background! The level is just the same. I fixed a few ongoing bugs: the swinging is broken in my previous post for some reason, and as always, collision detection issues, of which I am sure there are many more. It's just the beginning - I want to add plenty more details, such as cracks in the walls, hanging washing, benches etc. I'm hoping these details should help indicate which way the gravity is going each time. And look cool.

Here's how the foremost part of the background looks:



Watch out, time to geekify! Though I'm talking about geeky things, I'm also trying to use something approaching layman's language. If you feel brave enough, you can try to follow. It really isn't all that difficult and I've provided lots of useful links (wikipedia).

< geekicity >

As everybody and their mum knows, flash graphics (as in, the ones you create within flash) are vector based. Flash is also happy to deal with bitmaps. Now I know you all know the relative advantages and disadvantages of vector graphics and bitmaps, but here's a reminder...

Vector graphics:

advantages: they take up very little memory, seeing as they only consist of a series of instructions on how to draw something (curves and points etc.). You could make a vector graphic that's more memory intensive than a bitmap, but that would be dumb. Also, vector graphics have no resolution, you can scale them up all you want and they're still crisp.

disadvantages: Seeing as vector graphics are being redrawn every frame (hence their crispness), this does demand a hell of a lot from the processor. Slower computers would not be able to cope with large, complex vector graphics moving and rotating all over the place.

Bitmap:

er... pretty much the opposite of vector graphics - they take up a lot of memory, but they're quick to draw.

So for the backgrounds, I didn't want them to be bitmaps because something that big would make the file unacceptably large (and slow to download). But with vector graphics older computers would have a hard time.

By the way, my computer is my benchmark. It's a two-year-old macbook (one of the first white ones). Not too shabby, but not all that amazing either, and what with macs never having dealt that well with flash, I feel it's a sensible benchmark. If your machine is slower, well, poo!

So what have I done? Well the Actionscript aficionados among you will know that the bitmapdata class has a function called draw which will take a display object as its argument and create bitmap data from that.

So for everyone I just lost in that previous paragraph, there's a way that I can take my memory-efficient vector graphics and convert them into processor-efficient bitmaps. Wonderful, no? This means I can continue adding details to the backgrounds with relatively little impact on application size and performance. This is awesome, in case you hadn't realised.

</ geekicity >

So now you can see what Dreg's world might look like. The reason I spent so long on all this was to see how long it would take to create these backgrounds, as well as have an idea what they would look like. I haven't strayed too far from the look of the comic and film. It's allowed me to establish a work-flow and make sure it was possible to do more or less what I had in mind.

So though the acrobatics still aren't finished, nor are the background details, I feel it's time to attack the next big challenge - combat. This means animation, other characters, and AI. Urgh... I expect I'll be happily spending a lot of time just drawing more objects for the background before I'm ready to face such a daunting challenge...

1 comment:

  1. that's preaty cooool
    it now looks more like a game game

    I like the pseudo 3d background, but how about the same for the poles or other props in the foreground?

    =]

    ReplyDelete