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
most platforming engines break down if you have extremely odd surfaces, like I doubt even the mario galaxy engine by nintendo would work if you threw him into a cloud of 1 pixel volume obstactle particles.
Nice tutorial Pixelthief I can see the issue with small details, however when you start getting that small you are down to pixels which are always at right angles to each other so the detection gets difficult. You will have to take an average, like an 8 pixel area like Pixelthief suggested.
n/a
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
3rd September, 2008 at 20:09:51 -
Yep, all I'm worried about is the ray slipping through the pixel gaps and taking the wall behind the intended wall. This would work perfectly otherwise. Thanks a lot!
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath