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
feat: Add Systems #4
Conversation
- Add SystemManager - Add PositionSystem - Add PhyiscsSystem
star-dash/star-dash/.DS_Store
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to remove .DS_Store
s from being committed? It should be in the .gitignore
, not sure why it's being tracked here
var dispatcher: EventModifiable { get set } | ||
var entityManager: EntityManager { get set } | ||
|
||
func update(by deltaTime: TimeInterval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I clarify what is the role of this method? I'm a bit confused because I noticed that not all systems (like PositionSystem
) override this method. And in PhysicsSystem
, the update
method basically sets all the force vectors to 0. Under what circumstance is this method called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It more like for timed components in the game, e.g. those that after a certain time will stop working like powerups
|
||
protocol System { | ||
var isActive: Bool { get set } | ||
var dispatcher: EventModifiable { get set } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this dispatcher
do ah? Does the dispatcher
represent an object that can receive requests/events and route them to appropriate methods? If so, I think it has a different set of functionalities from an EventModifiable
. Perhaps a new protocol called EventDispatcher
can be created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, do all systems require a dispatcher? If not, perhaps this property can be optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep can make an EventDispatcher. Can make it optional too
Changes made thus far