Yes they are straight walls, with atm only 90�angles (for floor, side wall & ceiling), but ideally I would also like to have some more fancy angles later..
I've found a formula on this forum about Cosinus & sinus (which I dont really understand..but it's working so far). Im applying it with the help of 2 detectors for X & Y pinned to my ennemy and the event looks like this:
Detector X overlapping wall
--> Enemy set X to self.x-cos(self.Bullet.AngleOfMotion)*self.Bullet.Speed*dt
Detector Y overlapping wall
--> Enemy set Y to self.Y-sin(self.Bullet.AngleOfMotion)*self.Bullet.Speed*dt
That works...but there is still a problem when this happens:
(orange rectangle is Y detector, blue is X)
<img src="http://i.imgur.com/Qh79369.jpg" border="0" />
There, the enemy will just get stuck (if not worst)...as the wrong detector got triggered first.. :/
And if I make both detectors the same size to cover the 4 corners "holes" then it doesnt work at all as they are both triggered at the same time...
I dont know what to do here, I've tried many things but unsuccesfully so far..and as I dont really understand that cosinus formula It's hard for me to "tweak" it, so if anyone could help me on this that would be great, thanks.