Dark Lighting (a la Pokémon caves)

Get help using Construct 2

Post » Sat Mar 10, 2012 4:05 pm

Hello to everyone, I just had one problem that I've been thinking about. I did a quick bit of searching (read the faq, read a few pages back in the forum) and while my reading list is definitely longer than it was before, nothing seemed to directly apply.

The Problem: I am making a pac-man game for a class, and I wanted to add a lighting gimmick (like this). Essentially, a circle is centered around pacman, and with the more pellets he eats, the larger the circle grows. There were two solutions I came up with:

Either have a rather large black image with a transparent hole in the middle (the 'bright' circle) centered on pacman
or
have the whole layout covered in a black sprite with a circle centered on pacman that makes the area enclosed within it transparent.

I tried out the former solution, as it seemed to be the easiest to implement, and I got it to work. The only problem is that the image that is centered about pacman has to be pretty big, basically it needs to be around four times as big as the size of the layout. It works, but makes me worry about memory/system compatibility/etc.

So it seems to me that the second solution would be best. Would anyone be able to point me in the right direction in getting it to work? I know how to set up the two objects that would be involved (the circle centered about pac-man and the black sheet covering the layout), but how would I make only a specific area of the black sheet become transparent?

While I'm at it, I may as well ask if there are any simpler solutions anyone has in mind. Thanks for your time.
B
7
Posts: 4
Reputation: 487

Post » Sat Mar 10, 2012 5:12 pm

Last edited by Yann on Sun Sep 14, 2014 9:24 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Mar 10, 2012 10:11 pm

well, thanks a lot.

I feel quite dumb.
B
7
Posts: 4
Reputation: 487

Post » Sat Mar 10, 2012 11:08 pm

Don't worry, it happens to all of us, especially when you're just starting out. :)
B
8
S
2
G
6
Posts: 44
Reputation: 3,007


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], imnotspecial, totoe and 12 guests