Greg Solo
Jan 2, 2021

--

Hello there, Jonathan! Thank you for your kind words πŸ™ I am super happy you enjoy this tutorial 😊 It gives me a huge boost of motivation! Thank you! πŸ™πŸ™πŸ™

You are totally right, `input.ts` notifies only direct children of the `Game` entity (at this moment there are three: `Grid` and two `Fleets`). We could "propagate" events down to `Node` (or `Ship`) but we don't have to.

I reason that I want to be able to "turn off" other `Nodes` when one is activated (which will become essential for us in later chapters, to show/hide where `Ship` can go). And this can be easily done when we have access to the whole collection of items, in this case, on the `Grid` level. So, a big chunk of the next installment will be dedicated to building `GridOnclickComponent`.

--

--

Greg Solo
Greg Solo

Written by Greg Solo

Software Engineer. Immigrant. Entrepreneur. I have been telling stories through software for 15 years in the hope to craft a better future

No responses yet