Tuesday 29 January 2008

#%£@!!!

We've run into a bit of a problem here...
Unfortunately, the idea I had for the level intro sections is impossible without use of an extra module and a shizelload of manual pixel-by-pixel fiddling to make it fade in. See, in SDL (the C++ module PyGame uses), there are three types of alpha: colourkey, surface and per-pixel. Colourkey is the 1970's-reminiscent idea of having one colour in an image that is converted to transparency, so you'd put your non-rectangular image on a purple background for example and that background would be removed by the program. It's not particularly useful when you want smooth edges. Surface transparency makes an entire image (rectangular of course) have a certain alpha value - so, for example, every pixel in the image would be half-visible. This is what I use for fading in scenes. And finally, per-pixel is where every pixel has its own alpha value - this is necessary for the spiffy transparency effects on the level intros text box.

And here's the thing - you can't use surface alpha and per-pixel alpha on the same image. So to have it fade in, the text box needs to be completely opaque and rectangular. And to have the cool alpha effects and rounded corners, I leave myself unable to utilise the benefits of surface alpha for fading in. Without the fading, the text box's entrance looks particularly rubbish; and it's just disgusting as a rectangle. So, it's back to the drawing board.

I've decided after some deliberation, collaboration and thinkingination that actually the level intro sequence might look better without a text box. If I implement a text box, I know I'll end up making it draggable simply because draggability is so cool and it's always enjoyable to code, and then the continue button will be attached to the text box, and suddenly we have Microsoft Windows in game form. It'll almost certainly be better for Slipslide (and the player) if I actually design a unique interface for it, as I've done with the main menu.

But meanwhile, on the brighter side of things, Slipinator (the level editor) is now underway again. I'm working on a drag-'n'-drop method where you drag objects onto the level, and it's actually been very successful so far. Not only does it not crash now that I've done away with the 500 buttons approach, it also means that holes and other things can now be added as well as just blocks. And it's only taken me 200 lines so far!

No comments:

Post a Comment