I was wondering if there's any alternative to Shape:testSegment for Love versions 0.8.0 or later.
I was planning on using this function to determine if there was any obstacles or other enemies between an enemy shooting and it's target. Mainly, I don't want enemies shooting other enemies, so I want to check if there's any obstacles, namely other enemies, in their line of fire before shooting. So far, all enemies, players and obstacles are implemented with love.physics, so there are shapes, bodies and fixtures for them all.
Is this a good idea? Or should I consider some alternative methods for this type of checks?
Shape:testSegment
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: Shape:testSegment
Love.physics is overkill for simple games. I'd suggest alternative methods of doing that. You can test for intersections using a line intersecting test function in the love2D wiki's snippets. There are lots of other alternative methods so you should try one that suits you the best.
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
Re: Shape:testSegment
Thanks! This was exactly what I needed!slime wrote:World:rayCast
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest