Page 10 of 12

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Mon Aug 11, 2014 4:41 pm
by Ranguna259
Weird stuff right there. Glad you got it to work :megagrin:

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Mon Aug 11, 2014 8:52 pm
by davisdude
InsomniaNY wrote:So I got it working, though I'm not exactly show why it works this way. Here's what I had to do to get it to work:

Code: Select all

	lightMouse.setPosition(p.x, p.y)
	mouseP = {love.mouse.getPosition()}
	angleMouse_toPlayer = math.atan2(mouseP[1] - p.x, mouseP[2] - p.y)
	lightMouse.setDirection(angleMouse_toPlayer + math.pi)
The problem is that you're using the x coordinates first in math.atan2, you should use the y coordinates as the first argument, i.e.:

Code: Select all

math.atan2(mouseP[2] - p.y, mouseP[1] - p.x)

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Mon Aug 11, 2014 9:03 pm
by InsomniaNY
davisdude wrote:
InsomniaNY wrote:So I got it working, though I'm not exactly show why it works this way. Here's what I had to do to get it to work:

Code: Select all

	lightMouse.setPosition(p.x, p.y)
	mouseP = {love.mouse.getPosition()}
	angleMouse_toPlayer = math.atan2(mouseP[1] - p.x, mouseP[2] - p.y)
	lightMouse.setDirection(angleMouse_toPlayer + math.pi)
The problem is that you're using the x coordinates first in math.atan2, you should use the y coordinates as the first argument, i.e.:

Code: Select all

math.atan2(mouseP[2] - p.y, mouseP[1] - p.x)
I think you misunderstood what I was saying. When I had math.atan2(y,x) it didn't work. When I switched it to math.atan2(x,y) because I figured I might as well try, it worked perfectly. I know it's supposed to be y,x....but for some reason it's working the opposite for me.

NOTE: I'm simply working with the light right now, I haven't implemented any shadow objects...though I don't think that matters.

I'll be inserting shadow objects shortly, but I had run into a speedbump... I'm importing a tmx file created in Tiled for my map, which I was hoping I could auto-generate shadowobjects from based on my "Walls" layer, but apparently that's not possible (or I just can't see documentation on how that would be done)...I tried creating a normal map png file, but it seems I'll have to create individual shadow objects for each platform/wall in my level.

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Mon Aug 11, 2014 9:07 pm
by davisdude
Ah. My bad. That's quite odd, though.

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Thu Sep 18, 2014 3:13 pm
by FryDay444
Will these shaders work on a mobile device (Love for Android or iOS)?

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Sat Sep 20, 2014 2:53 pm
by jjmafiae
Can I use this in a commercial project and what about credit?

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Mon Sep 22, 2014 4:56 pm
by megalukes
Sorry for bothering again, but did someone manage to solve the translate and scale issues? Thanks!

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Sat Oct 04, 2014 7:27 pm
by nucular
Is it possible to get the "light shine" drawn by drawShadow() and draw it on the screen in multiply mode (to allow the light rays to be blocked by the objects) without modifying the library? Actually I'm kinda confused by these functions... mind to elaborate a bit in the documentation?

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Sun Oct 26, 2014 7:30 pm
by ThatMattGuy
Hello!

I am new to Love2d and want to know how you use physics alongside of this? Would I need to have a physics world and a light world?

Thanks

Re: Löve "Light vs. Shadow" Engine [0.4.3]

Posted: Sun Oct 26, 2014 8:08 pm
by Guard13007
ThatMattGuy wrote:I am new to Love2d and want to know how you use physics alongside of this? Would I need to have a physics world and a light world?
Yes. Good luck and don't give up!

(I'm relatively new too, and working with this engine as well (albeit the other one which is a rewrite).)