I would like to see a new built-in feature that will allow me to determine what side of a bounding box is overlapping. This may be confusing, so here is an example:
Say X is a mob, and Y is something it is not supposed to be on. Now, if I run a check and see that X is overlapping Y via bounds_dist(), then I can catch X...but I can't do much about it. My first thought would be to modify it's step_x and step_y to shove it off, but I don't know which way to shove it. If X is overlapping Y's right side by 3 pixels, I want add 3 to X's step_x. I have no good way of figuring out that information, though.
This is why I would like something along the lines of bounds_side(a, b) (Although I'm not the best name-maker around), that will tell me which side of b a is overlapping.
ID:814392
Jun 13 2012, 5:25 pm
|
|||||||
| |||||||
Jun 13 2012, 8:56 pm
|
|
Here is a quick example of a workaround for this, but it is much more bulky than need-be:
|
It's only bulkier than need-be because of the way you're programming it. There's already a way easier and more clean way of going about this. Here's an incomplete example:
proc/bounds_side(atom/movable/case, atom/movable/check) I'd be more than happy to assist you, given you repost this in the Developers Help section. There just isn't a need for this feature, and I'd be more than happy to assist my skinny little buddy if you repost :). I'll even complete the code I've provided for you, if you repost. This information does belong in there, hence why I haven't posted a complete example; just a demonstration. |