Skip to content
Discussion options

You must be logged in to vote

Hi @TanZng,

thank you for giving Ark a try and for posting your question!

Using an ECS is indeed a bit overkill for a small game like pong, so I will try to answer your question in a way that would scale well to e.g. a massive RTS with dozens of players, each commanding a huge army. ;)

First, you should ideally store your player entities in a resource so that they are accessible where you need them, without having them as method arguments.

You can easily query for all entities that have a relation to a particular player, as described here (note that there are two ways, I will focus on the second, more flexible one). Your input system would look like this:

type InputSystem struct {
    filter

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TanZng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants