Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Touching sprite works with self #377

Closed
griffpatch opened this issue Jan 12, 2017 · 6 comments
Closed

Touching sprite works with self #377

griffpatch opened this issue Jan 12, 2017 · 6 comments

Comments

@griffpatch
Copy link
Contributor

Expected behavior

Expected touch 'self' to always trigger... like in Scratch 2

Actual behavior

I was pleasantly surprised that with multiple clones, the touching 'self' only triggers if the clone is touching another copy of itself. This is by far the better solution, but I just wanted to flag it up as a difference. If you keep this functionality (and I really hope you do) then please add in an option to select the current sprite from the list of available sprite collisions). In Scratch 2 all clones are red all the time, and it runs VERY slowly. I'd also like to say well done for making the collision detection so much quicker in scratch 3 (even if general script processing is far slower at present - Do you expect the general script speed to get better as the engine is progressed? or is this going to be a balancing act?).

Steps to reproduce

Load up this project '138856666'. Run the project and see that sprites that are not colliding other clones are not coloured red.

Operating system and browser

PC, Chrome

@CosmicWebServices
Copy link
Contributor

I would like this implemented but maybe for cross-compatibility self can be like it was and then there can be self-clone or something like that

-@icycoder on scratch

@griffpatch
Copy link
Contributor Author

griffpatch commented Jan 12, 2017 via email

@SillyInventor
Copy link
Contributor

This stems from the line
if (testID === drawableID) return false;
in _filterCandidatesTouching in renderer

Changing isTouchingSprite to parse self at the beginning as follows:

if (spriteName == this.sprite.name) return true;
else if (spriteName.contains(''-clone")) spriteName = spriteName.split('-')[0];

will result in the compatibility / functionality suggested.

Though I prefer it as is.

@griffpatch
Copy link
Contributor Author

griffpatch commented Feb 1, 2017 via email

@griffpatch
Copy link
Contributor Author

Maybe we should re-label this one as I don't think it should be flagged as a bug. It may be different behaviour from scratch 2.0, but the behaviour in scratch 2 causes this feature to be unuseable in this configuration anyhow as it always resolves to touching... Therefore it will never be used like that and is safe to be released to work in this new configuration for scratch 3... the way it should always have worked anyhow. I'm worried that by leaving it as help wanted and bug it will get fixed! ;)

@thisandagain
Copy link
Contributor

thisandagain commented Feb 10, 2017

I agree. I'm happy to keep it this way and just add a note to our compatibility wiki:
https://github.com/LLK/scratch-vm/wiki/Compatibility

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants