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

[v2] Create slick.world.frame method to update entire world. #14

Open
erinmaus opened this issue Jan 8, 2025 · 0 comments
Open

[v2] Create slick.world.frame method to update entire world. #14

erinmaus opened this issue Jan 8, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@erinmaus
Copy link
Owner

erinmaus commented Jan 8, 2025

  • Allow setting a velocity on entities and updating the entire world at once with a slick.world.frame method that takes a deltaTime. All entities will be simulated, given their velocity and the elapsed time, to prevent any potentially tunneling caused by one-by-one updates. Currently, update, etc treat all other entities besides the one being updated as being stationary.
  • Add local collision filters and local collision response handlers to slick.entity:
    • The collision filters will be used during slick.world.frame to see what objects interact with this one. They can return visit functions as well like the current collision filter functions.
    • The local collision response handlers, if set, will be used in place of the global collision response handlers. The default behavior will be to use the global collision response handler.
  • Add events like startContact, stopContact, move and potentially others to slick.entity. A function provided to this event will be called when the entity starts or stops touching another entity or shape, for example.

To keep it generic, all methods that take a function can take a table with a __call metamethod. And to keep it simple, only one function can be registered at a time to an event, collision filter, collision response handler, or other things that use functions provided externally. More advanced behavior will require use of pub-sub libraries or such!

@erinmaus erinmaus added the enhancement New feature or request label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant