Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Bump: adding and removing objects from the world #180
I ran into some trouble when trying to use the bump plugin in my game. All the collidable objects get loaded into the bump world table just fine when calling
I ended up writing a bit of a hack to work around this by storing all the wrappers in a
So two questions: the first being did I miss something that's already in the code? Is there a better way to do what I did above?
If not, would you accept a patch to the bump plugin to allow for this kind of thing? Is the approach I used above OK, or is there another way we should do it? The other alternative I could see would be storing the wrapper table as a field in the original table which is in the
I think the best way to handle objects that can be deleted and recreated is to just a active flag to the object. Then whenever you call world:move you will pass in a filter that will change the way the collision is handled based on that flag.
I see; yeah I suppose using a filter function would have been a cleaner way to do this. During development I felt a bit like I was grasping at straws since I was framing the problem in terms of "items to be added and removed from the world" rather than "the contents of the world are fixed at initialization time, and you can dynamically choose to ignore them on a per-case basis".
I wonder if the docs could be improved to suggest this pattern to folks like me who were scratching their heads wondering how to do it and not finding any guidance. Maybe I could put together a "limitations" or "tips" section for the readme if you like?