Is "fog of war" possible?

Discuss game development design and post your game ideas

Post » Tue Jan 27, 2015 8:23 pm

I want to have a good "fog of war" effect in my topdown game and wondering if it is possible in Construct.
It will be a maze game where you are exploring a maze and have to find the keys to get to the exit.
System:
ASUS rog G550JK - 12GB ram - Nvidia GeFroce 850 2GB
Constuct 2 personal
B
6
Posts: 28
Reputation: 781

Post » Tue Jan 27, 2015 8:58 pm

I believe you could either create a giant grid of black spots that you set the opacity as needed (0 for current area and like 50 when not close).

Or, from my understanding, it may be possible to do it more cleanly and dynamically using the canvas rather than individual objects.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826

Post » Wed Jan 28, 2015 11:04 am

@Aasmund, is the Fog of War in my project like the one you're going for?

I use Rojohound's Canvas plugin to save memory. Basically, set a "Darkness" layer that's black and non-transparent over the main layer. Put the canvas on that layer, then just generate "lightwindow" sprites (these are just black circles with the blend mode set to DestinationOut) where needed, then paste them to canvas and destroy.

I think I've explained that right (going from memory here!) but that's the gist of it.

EDIT - sorry, I think it's the canvas that needs to be set to Destinationout - the lightwindows can just be ordinary black circles (I use the paintbrush tool in C2 set to 0 hardness to get a nice gradient radiating out from the centre)
B
15
S
4
G
1
Posts: 286
Reputation: 1,988


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests