minigame's Forum Posts

  • Ah I understand now I think. You could do a three layer setup. Objects on the bottom layer and light in the middle. Then if any object has a line of sight to the light you can move it to the top layer.

    It 'kind of works'. 'Works' because the sprite appear and disappear according to the LOS to light. 'Kind of' because it doesn't look normal, since I will see all the sprite even if the light is illuminating just a little part of it, or the sprite will get black even if I am seeing a part of it.

    Another idea is to just do shadows yourself, either with the “paster” or “custom draw” plugins. Basically it’s just a quad from each edge with two points projected with a ray from the light to the edge corners. The trick to show objects in the light and hide those in shadow would be to only use edges facing away from the light. Anyways there was an old example of this done with the canvas or paster plugin I think.

    Will have a look, would then work normally on mobile?

  • Ashley, any chance of achieving this?

    Make shadows cover other objects, and still see the objects normally when not covered by shadows?

    Like the guy say here:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Then maybe putting the light object in a layer below?

    Light must stays on top of other objects or they will be seen anywhere don't matter if the light illuminates then or not. :/

  • R0J0hound, this makes the objects get all black, as if their own shadow is covering then. As the guy said in one of the links above.

    Can you do this and still see the sprites normally? If yes, can you explain or show how? Because I tried everything I could think of. Only way I see is to give every shadowcaster a black frame and use it if player do not have LOS to him, but that's not right at all haha.

  • People have asked this way before and till today it seems that no one knows

    Some old threads asking the same thing:

    The shadow mystery remains

  • Anyone knows if this is possible? I've been having no success.

  • Hi all, little question: I'm using the ShadowLight object together with the ShadowCaster behavior, and the results are fine, but the shadows stays underneath objects.

    I would like to make shadows cover objects, is that possible? And how would I?

  • dop2000 thanks man

    I will spent some more time with it today and if I still struggle I'll make a capx.

    Appreciated!

  • alextro

    Cool, I ever wondered how this was made, thanks for sharing:)

  • lucaszfazzi cool:)

  • I think you can move enemies to the center of layout (or other position) if they are overlapping a solid object, and when they aren't overlapping anymore make then visible.

  • Links all broken alextro, any chance you reupload?

  • This should work:

    > Door overlapping Ground
        System-> Pick 0th Ground instance  :  Door Set room1=Ground.room
        System-> Pick 1th Ground instance  :  Door Set room2=Ground.room
    [/code:12xi4gcj]
    
    You can also use Ground.pickedCount expression to check how many Ground instances are picked in this event.
    

    Thanks again dop2000

    Ooooh, pick nth instance! Shit I miss that sonofabitch ^^

    But it didn't work right yet, all doors are getting room1=0 and room2=1 as if I was picking the two first grounds of the layout and not the two ones the door overlaps. And yes, they are as a subevent of Door overlapping Ground.

    I tried picking both ground separately by lowest and highest 'room', same problem. It seems to ignore the 'Door is overlapping Flor' event and pick only two rooms at all.

    Tried making For Each Ground and Door events to pick then all but non works. :s

  • Try "For each" as a sub-event:

    Door overlapping Ground
        For each Ground      ....
    [/code:1cznt9lu]
    

    Thanks dop2000;

    Well, this doesn't kill the riddle. I need to store ground.room to door.room1 (first ground) and ground.room to door.room2 (second ground). So I know what are the two grounds that the door is overlapping.

    I can do it setting room1 and room2 of each door manually, but the code would be very useful to use in other situations, and I didn't figure it out yet

  • I have an ebook that teaches how to deal with this problem, basically the workthroughs he says are:

    You can try changing the layers paralax to 0, 0; make the background image bigger than the window size; give the background a Anchor behavior and adjusting it, or add a layout color.

    Please try those and let me know if it works.