Hi all,

Quick question... I'm working on my first attempt at a real game engine. One of the things I want to do is to provide a field of visibility that blends out items that appear higher than the player layer as they move closer.

I've created an array that has alpha values 255, 170, 85 down to 0 in the area around the player.

If I don't use alpha blending and instead I simply don't draw the 9 around and above the character, it doesn't slow down. As soon as I start using the drawAlpha function of TDXImageList.items, my frame rate drops to 11. Normally I time it down to 25fps from around 66-72fps (we don't need lots of speed since its supposed to have a retro feel).

Although this isn't a necessary, it does look nice, so Is there any other way of achieving this type of blending, without the slow down? Am I simply using the wrong software configuration options (Surface is 640x480x24)?

Just in case the rest of how it works is relevant... it goes something like this...

[pascal]
dxd.surface.fill(0);

yLoop
xLoop
Calculate map pos from player pos and xLoop,yLoop

Draw map tile using TDXImageList.items.draw(dxd.surface,xCoord,yCoord, 0);

Obtain alpha value from alpha map

Draw overlapping tile using TDXImageList.items.drawAlpha(dxd.surface,xCoord,yC oord,0,alpha);

End xLoop
End yLoop

// Draw player sprite

// Movement processing

// Draw console command results/debugging text/console

dxd.flip

[/pascal]