I would highly suggest to study first the asteroid panic from @pspeed. There is a thread Asteroid Panic: Why is Spatial in HashMap instead a Component - #18 by ia97lies of mine where I did try to understand that implementation. I asked a lot of stupid questions and got a lot of good and very detailed answers there. With that help it took me about 2 days to write my own simple clone of invaders with ES
And this is as well a helpful thread ES Design Question - #33 by pspeed with a lot of good advices/hints/explanations.