#5947 - rdvabreu - Tue May 13, 2003 6:55 pm
Hi
I am a fan of the "Commandos:Behind Enemy lines" game and I was thinking if it was possible to create a sort of "cone of vision" on the gba.
Because it is a "scroll" type game I was thinking of one of the MODE0, 1 or 2 modes. Creating the normal main background and then with the other spare background painting a cone. The other technique would be painting the whole screen everytime with the "mode 13" type style.
Anybody out there has any ideas about implementing this technique?
Thanks in advance.
un saludo
Ramon
#5954 - niltsair - Tue May 13, 2003 7:47 pm
I never saw it, but i'm guessing you want to only displat part of the screen, right?
There's 2 techniques that i know of.
The simpler one, would be to use mode 0 or 1. The top layer would only be a black layer with a hole where you want to display the screen.
The other one would be to use the 'Window' feature of the Gba, and to get a shape different of a rectangle, then adjust it at every scanlines. Never tried it, but i'm pretty sure it do-able.
#5961 - rdvabreu - Tue May 13, 2003 11:53 pm
A better explanation would be the following:
Imagine that you have a typical grass, stone field scenery and then on top of it imagine a "soldier" with a carrying a torch light on. When the light hits the ground it highlights the ground a with a brighter colour where ever the light hits. This is the cone of vision of a soldier. The complicated part is that you must paint the main background (ground, grass, stone, etc) and then on top of it depending on the size of the cone you want to create another background (transparency?) highlighing the ground with a brighter colour.
I have seen a Mario demo somewhere where there is a lamp shining on the street and then it highlights the background wherever the direction of the light goes, so I know its possible to do!.
Thanks in advance
un saludo
Ramon
#5962 - Sweex - Wed May 14, 2003 12:19 am
I'm not sure I fully understand what you want, but you could use either a layer (in mode 0 or 1) or a sprite and use alpha blending. Backgrounds and sprites both have rotation capabilities.
It gets complicated when you actually want to block the "vision" by ie. walls
#5963 - niltsair - Wed May 14, 2003 12:32 am
If it's to 'highlight' an area, then you would only need to draw the cone in white, and overlay it over the rest with a transparency set for that top layer.