Löve "Light vs. Shadow" Engine [0.4.3]
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Löve "Light vs. Shadow" Engine [0.4.3]
Weird stuff right there. Glad you got it to work
Re: Löve "Light vs. Shadow" Engine [0.4.3]
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.: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)
Code: Select all
math.atan2(mouseP[2] - p.y, mouseP[1] - p.x)
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
-
- Prole
- Posts: 4
- Joined: Sat Aug 09, 2014 8:58 pm
Re: Löve "Light vs. Shadow" Engine [0.4.3]
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.davisdude wrote: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.: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)
Code: Select all
math.atan2(mouseP[2] - p.y, mouseP[1] - p.x)
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]
Ah. My bad. That's quite odd, though.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Löve "Light vs. Shadow" Engine [0.4.3]
Will these shaders work on a mobile device (Love for Android or iOS)?
Re: Löve "Light vs. Shadow" Engine [0.4.3]
Can I use this in a commercial project and what about credit?
Re: Löve "Light vs. Shadow" Engine [0.4.3]
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]
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?
-
- Prole
- Posts: 1
- Joined: Sun Oct 26, 2014 7:26 pm
Re: Löve "Light vs. Shadow" Engine [0.4.3]
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
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
- Guard13007
- Party member
- Posts: 133
- Joined: Sat Oct 25, 2014 3:42 am
- Location: Internet, USA
- Contact:
Re: Löve "Light vs. Shadow" Engine [0.4.3]
Yes. Good luck and don't give up!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?
(I'm relatively new too, and working with this engine as well (albeit the other one which is a rewrite).)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest