Thursday, April 05, 2007

IT'S A TRAP!

I finished coding up the windtraps.


The technique behind this is pretty easy. What I do is create a static texture for all windtraps in white. During rendering, I first render the white texture with an overlay color, and on top of that, I render the normal windtrap texture. And in the Update() function of the windtrap, I have a timer to increase/decrease the color every 1/10th of a second. Simple, and effective.

I will probably add this texture to the SpriteSheet, as it would reduce texture swapping. And texture swapping is bad, m'kay?

I also added a link to the development blog of an online friend of mine. He's developing a 3D engine and a bunch of games with it. Except it takes him a decade to produce it all. Yes, I'm serious. A decade.

4 comments:

Anonymous said...

YAY!

Fundynamic - Stefan Hendriks said...

What i did (do), is use a Palette trick. Its a 256 bitmap, where color index x is the windtrap 'fading' color.

Once you draw the thing, you simply change that color index in the palette to the appropiate fading color (which can be any tint you like, ie R G B , where B is a value between 0 and 255 which gives a very smooth animation). Then you draw it ;-)

Toolmaker said...

Won't work with me. DirectX 9 no longer supports palettized bitmaps, and automatically converts them to whatever the screen format is.

The palette trick is exactly how the original Dune 2 worked aswell(I knew I forgot somethng when writing the entry :), I wanted to explain how it worked in the original).

Anonymous said...

cool a lot of updates :D