procrastinator's Forum Posts

  • Yeah that'll be great if he fixed it. I didn't even know it existed until he posted. I should read the wiki/docs more!

  • That's a nice method but it's flawed unfortunately. It's too slow (halves the framerate here) and if you move the lightsource to behind the very bottom left circle the object isn't hidden anymore. Almost there... probably needs a little tweaking to get it right.

    I'll get this damn clipping done today and then I'll put a bit more time into this problem.. hmm..

  • Now the fun begins

  • Not too bad but yeah.. too laggy to do anything serious.

  • Strange.. but I guess something's changed in the new version that you're using?

  • Some nice looking stuff guys. Very inspiring.

  • http://willhostforfood.com/users/P/procrastinator/ifthenelse_crash.cap

    Is that what you're after?

    It crashes for me..

  • [quote:262t7gxu]At this rate, you're going to be one of the forum math people!

    hahah I hope not. I suck badly at maths. I was just lucky I figured this out!

    [quote:262t7gxu](I'm still working out how you did this - haven't had much time lately, but I think I'm getting the idea.)

    I'll try and comment how I did it for the next version. I rarely comment my stuff when I'm hacking away at it but I really need to with this so I can remember in a years time what the hell those formulas were

    [quote:262t7gxu]By the way, I'm trying to work out if objects are shadowed in the game I'm making (for a situation where a swarm of small objects have to hide from light). I was using instant-hit bullets or LOS objects to detect whether they're shadowed, but there should be a way to adapt this method to work it out, right? I might try it sometime this week.

    (Unfortunately, 'Object is overlapping shadow' doesn't work - I guess distorted objects don't count for collision purposes!)

    At this rate, you're going to be one of the forum math people!

    (I'm still working out how you did this - haven't had much time lately, but I think I'm getting the idea.)

    By the way, I'm trying to work out if objects are shadowed in the game I'm making (for a situation where a swarm of small objects have to hide from light). I was using instant-hit bullets or LOS objects to detect whether they're shadowed, but there should be a way to adapt this method to work it out, right? I might try it sometime this week.

    (Unfortunately, 'Object is overlapping shadow' doesn't work - I guess distorted objects don't count for collision purposes!)

    As I was reading that I was immediately thinking "try collision detection with the shadows" but you say they don't work eh... damn. Right... just tried LOS... here you go. Although it depends what you class as "being in shadow"...

    http://willhostforfood.com/users/P/procrastinator/circleshadowcaster_v0.41-LOS.cap

  • Whether you like someone or not, doesn't mean you should deny yourself the knowledge you'll gain from his tutorials. I wasn't too interested in writing a platformer but I learned a load of things from his tuts that will serve me for other projects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Globals don't work? Or are they just per layout then? hmm

    What about creating a new event sheet with variables that'll store the info you're trying to pass and including that sheet in both layouts' events. Then just update in one layout and read the info in the other. I'm pretty sure there's a better way... not even sure if that would work but logically... it should Might be a pain if you have craploads of variables you need passing from one to the other..

  • That's a nice trick indeed. I didn't notice the mask shader. I was wondering if Construct had masking capabilities..

  • Here's a fixed version. In the older versions one side was inaccurate. I had my triangles wrong when working it out and used atan instead of asin It works now! Still need to fix the clipping..

    http://willhostforfood.com/users/P/procrastinator/circleshadowcaster_v0.4.cap

  • Yeah I tried your demo earlier and noticed it was a lower FPS. I think the shadowcaster behaviour sends scanlines out in all directions and works from there? That's the only thing I can think of..

    The good thing about distort maps is you could assign a texture to the shadow itself. You could have gradient shadows where the opacity falls off as it gets further away from the circle for example. I'm sure there are other uses for a textured shadow... hmmm

  • Looking good!

  • Okay here's a tidier version. I've put the drawing into a function so all you need to do is place your own circles in the layout editor, loop through each circle and call the function as in the example. I've left the create function in there (but disabled) in case you want to create circles at runtime. Just pass the 3 params - x,y,radius.

    Still haven't fixed the things I said I would because my brain is in meltdown today.. I think I overdosed on math last night! Anyway, it's getting there I think and it's workable for now.

    http://willhostforfood.com/users/P/procrastinator/circleshadowcaster_cleanedup3-functions.cap