if its a map loaded from a file you can have all the angles and positions of walls loaded at the beggining of a level and then you can use the rotated angle of the wall.
if not, im pretty sure pixeltheif has loads of info to drop on you on this subject.
n/a
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
3rd September, 2008 at 07:19:15 -
If the walls are destructible then it is impossible to do it that way.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
If the walls are destructible, then they must be active objects, right? That means that they would have alterable values that can be referenced, right? If you can't make alt values work, would you be able to use the object's direction?
Find the distance between the top Y, bottom Y, left X, right X of the sprite
E.g tan A = Y/X
Tan A = (Y top - Y Bottom)/(X left - X right)
therefore A = arctan (Tan A)
however i think MMF does this result in radians.
pi radians = 180 degrees
So A in degrees = A * 180/pi
This should theoretically work, if you can do it using this method.
My signature is never too big!!!
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
3rd September, 2008 at 09:07:42 -
MMF can't handle immense active objects without crying and stealing system resources. The walls are all backdrops. That math will work, and that's what direction I was headed in already, but how do I find that with a backdrop?
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
Cast a ray towards the wall, finding the point of collision with it
create two 2 active objects, set on the perimeter of a circle, both initially facing back towards your ray
rotate each object in opposing directions until they both collide
depends on how you want to use it. It will just give the inbetween angle on corners, instead of an exact up or down, but thats only within a small pixel span; I used 8. If you really need 8 pixel depth on those intersections, you can have it run another set of collision points, further away, and compare the angles with its next in line. In general thats pretty unnecessary though.
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
3rd September, 2008 at 10:55:36 -
I've been messing around with it, seems to be pretty solid! I noticed small 5-8 pixel gaps make it screw up a little. Is that just a problem with the platform engine or the wall angle checker?
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath