Tweak collision detection to detect top surface last, making bugs harder to squash

This commit is contained in:
Tony Garnock-Jones 2015-10-29 16:08:24 -04:00
parent de35a23a6c
commit cb6f60739d
1 changed files with 2 additions and 2 deletions

View File

@ -502,10 +502,10 @@
(three-corners top-left size))
(for/or [(p (in-list (list top-left top-right bottom-right bottom-left)))]
(or
(and (segment-intersection-time p r touchable-top-left touchable-top-right) 'top)
(and (segment-intersection-time p r touchable-top-right touchable-bottom-right) 'right)
(and (segment-intersection-time p r touchable-bottom-right touchable-bottom-left) 'bottom)
(and (segment-intersection-time p r touchable-bottom-left touchable-top-left) 'left))))
(and (segment-intersection-time p r touchable-bottom-left touchable-top-left) 'left)
(and (segment-intersection-time p r touchable-top-left touchable-top-right) 'top))))
(let ()
(match-define (vector left top) top-left)
(match-define (vector touchable-left touchable-top) touchable-top-left)