Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
make sprite collisions register events with all tiles touched #920
Currently, only the top most / left most wall that a sprite is touching has it's collision event trigger, which feels weird as the sprite is hitting multiple tiles but only counting collisions for one of them seemingly arbitrarily.
This defers the wall collision handling until after each tile the sprite would be touching has been checked, and then runs the collision events for each of them, instead of backing out after the first one.
fixes microsoft/pxt-arcade#1185 (except the sub issue of a request for non-bounding box based tile collisions, which I don't think will be feasible for now at least.)
worth a note this will cause a minor change in the block above's behavior (will return the rightmost collided tile instead of the leftmost), but that behavior wasn't defined / generally understood before anyways. I think that one might be good to change in the future, maybe just to be an option on the