procrastinator's Recent Forum Activity

  • 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.

  • 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..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • sold: hahah yeah I'm the same as you but seriously.. and I know it's been said many many many times but if I can do it, anyone can. I didn't properly understand sin / cos / tan / asin / acos / atan until I set about this. I knew sin / cos obviously to create circles etc but I didn't understand them. The only thing I remember being told was SOH CAH TOA and that certainly came in handy.

    mort: New version coming soon. Tidying it up and trying to put it into functions so you can just CreateShadowCircle(x,y,radius) and DrawShadowCircle(x,y) and create as many circles as you like. I'm not sure about ellipses just yet. I think that'll need some extra figuring out But before all that I need to fix the shadow so it clips at the edges of the display and doesn't leave a huge gap when the lightsource is too close.

  • I figured after seeing your post, I'd challenge myself to see if I could do it and learn some maths in the process. I gained some trig knowledge and a headache to boot! You math geniuses will probably be shocked at the way I went about it so go easy on a math noob!

    Anyway my initial test with an ellipse didn't work so I'll look into that tomorrow. The shadow is a distortion map btw.

    There are some obvious visual issues but I think you could probably tweak it or I may do tomorrow if I get the time.

    http://willhostforfood.com/users/P/procrastinator/circleshadowcaster_cleanedup.cap

  • Yeah swapping the other way round would be a nightmare since you'd have to work out what to do with the multiple items you've replaced by the sword. I'll finish off my crappy shooter thing today and then set about this and see if I have better luck this time around. Would be good to see David finish at the same time and people could see 2 different methods of doing it. Mine will be the messier one by far

procrastinator's avatar

procrastinator

Member since 29 Dec, 2008

None one is following procrastinator yet!

Connect with procrastinator

Trophy Case

  • 15-Year Club
  • Email Verified

Progress

16/44
How to earn trophies