From cb6f60739dd4ef57c6e4d13508e977f1a7fd33d2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 29 Oct 2015 16:08:24 -0400 Subject: [PATCH] Tweak collision detection to detect top surface last, making bugs harder to squash --- examples/platformer/main.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/platformer/main.rkt b/examples/platformer/main.rkt index c7269d8..3b001f9 100644 --- a/examples/platformer/main.rkt +++ b/examples/platformer/main.rkt @@ -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)