Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

get/isTouching is slow #24

Open
tjvr opened this issue Aug 5, 2017 · 4 comments
Open

get/isTouching is slow #24

tjvr opened this issue Aug 5, 2017 · 4 comments

Comments

@tjvr
Copy link
Member

tjvr commented Aug 5, 2017

Maybe we can think about changing the default? Do something smart with minimal bounding boxes perhaps?

@tjvr tjvr self-assigned this Aug 5, 2017
@bates64
Copy link

bates64 commented Aug 5, 2017

Perhaps model after the functions that Gamemaker's GML api provides as well as an isTouching function? It has optimised functions for different shapes.

I'd love a sprite.placeMeeting(x, y) function. Hell, isTouching could support (x, y) and (otherSprite) as one function...

@bates64
Copy link

bates64 commented Aug 5, 2017

On defaults, I'd say rename the current isTouching to something like isTouchingPerfect, and make an AABB version for isTouching to be. We must mention this in the docs though, since the behaviour is different to Scratch.

@tjvr tjvr mentioned this issue Aug 20, 2017
5 tasks
@tjvr tjvr removed their assignment Aug 20, 2017
@tjvr
Copy link
Member Author

tjvr commented Aug 20, 2017

the functions that Gamemaker's GML api provides

Hmm, I'm not sure about those. I find place_meeting particularly confusing: the naming isn't clear, and it's something you can easily implement yourself: indeed, I'd argue that implementing it yourself (setting the position, checking for a collision, moving it back) is less confusing.


I suppose we could allow setting the "shape" or "bounds" of an object: you might want to be able to treat an emoji as a circle for the purposes of collisions, for example. (🏀 anyone?)

If we were going to go down that route, I suppose it might make sense to offer polygon/polygon collisions etc. But that's a particularly nasty problem to solve, and it's unclear whether it would be very helpful.

Plain rect/rect collisions gets you surprisingly far.

@tjvr
Copy link
Member Author

tjvr commented Aug 20, 2017

@ISNIT0 Joe, what do you think about this? :-)

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

No branches or pull requests

2 participants