Shape:testSegment
Posted: Sat Jan 12, 2013 4:14 am
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?
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?