Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Addition of IsoScene and possibly IsoGroup to separate depth from physics. #4

Open
lewster32 opened this issue Aug 18, 2014 · 2 comments
Assignees

Comments

@lewster32
Copy link
Owner

It seems that using groups for both collision and depth sorting is quite inefficient. There are situations where you'd want the whole scene to be depth sorted, but only partial elements of it to be collision checked.

Consider a player in a scene full of objects, where you're not especially concerned about collisions between objects but you do want the player to collide with things (maybe a level made of static IsoSprites). In this situation, you only want to call collide between the player and the objects, and make use of the QuadTree/Octree for speed, but unless you pass a group in, the collision handler will simply check all objects in the scene.

Also, because IsoSprites usually need to be depth sorted, it feels like there should be a container that handles this automatically. With this in mind, I feel like an IsoGroup or IsoScene (or both) container should be implemented just to handle display ordering, and then groups could be placed in that to handle collision and so on, while allowing the groups to be used for collisions.

Any thoughts?

@lewster32 lewster32 self-assigned this Aug 18, 2014
@wassname
Copy link
Collaborator

This sounds like great idea. I also struggled with the differences between sorting and collision. But this seems like it would handle all scenarios and give flexibility without too much configuration.

At the moment, you can sort groups, which will mean a whole group is above or below another. This is probably what you meant anyway but I think the sorting should be on the children of the child groups and arrays. That way, if we have a cactus group, and a roadrunner group, we can sort them individually while colliding the roadrunners with the cacti with each otheri.

@orangeswim
Copy link

I ran into the same issue. I thought I could add isosprites to multiple groups. So I had a group for depth sorting and another for collisions. Of course I soon realized each sprite can only belong to one group.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants