Dark Lighting (a la Pok�mon caves)

0 favourites
  • 4 posts
From the Asset Store
1.200+ 16x16 pixelart tiles with animated tiles for your game!
  • 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


    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.

  • masking.capx

  • well, thanks a lot.

    I feel quite dumb.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Don't worry, it happens to all of us, especially when you're just starting out. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)