Skip to content

Fix isTouching()#11277

Merged
islemaster merged 2 commits into
stagingfrom
fix-isTouching
Oct 20, 2016
Merged

Fix isTouching()#11277
islemaster merged 2 commits into
stagingfrom
fix-isTouching

Conversation

@islemaster

Copy link
Copy Markdown
Contributor

Fixes a regression in the behavior of Sprite.isTouching() introduced by #11212. While the regression is live, it's easily illustrated by this demo: https://studio.code.org/projects/gamelab/J2-3Jb08SuAioE9pwQcyJA/view

I'd forgotten that our Sprite.isTouching() does not actually alias p5.play's Sprite.overlap, but was changed in #9702 to call Sprite.collide() with an extra argument that skips changes to position or velocity, to take advantage of the better tunneling code in collide(). Here I'm simply respecting that extra argument. I think we can eventually remove it, but I want to fix the regression first.

});

it('does not affect the location or velocity of the sprite', function () {
it('does not affect the location of the sprite', function () {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test's name said it checked that velocity was not modified, but the test itself only checked positions 😁 which explains how this slipped through the cracks before.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch 👍 lgtm

@islemaster islemaster merged commit 4969e07 into staging Oct 20, 2016
@islemaster islemaster deleted the fix-isTouching branch October 20, 2016 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants