I'm having some problems with my current game. Short description: It's a 2D game where you have to avoid the lights or you lose HP.

My problem is the following one:

Luna Problem

Here is the rendering process:

  1. The background is drawn
  2. The Moon image is drawn
  3. The point light is applied
  4. The collision layer and the images attached to it are drawn
  5. Player is drawn
  6. The foreground image (on the top left and bottom middle)

My problem is that the rendering does not look realistic. I need some help on how I could make the light coming from "behind" the collisions and applying it everywhere.

Thanks for your help.

  • \$\begingroup\$ Do you mean that the light isn't diffused around corners? \$\endgroup\$
    – oxysoft
    Commented Mar 14, 2014 at 10:52
  • \$\begingroup\$ I mean that i don't want the light to stop at the top of the branch but go "behind" the branch. \$\endgroup\$
    – Kamigaku
    Commented Mar 14, 2014 at 14:17

1 Answer 1


ideally, you configure group/mask for your lights and objects. Using this, you can tell your point light to ignore those branches. See a great write-up here.

alternatively, as a brute force approach, you could render lights before you draw your branch (though you should REALLY use the mask approach above):

// draw all objects that should create shadows


// draw your branches that should not cast shadows

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .