Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

confused...

How does this result in multiple cells being highlighted when I did not pass specific grid coordinates when calling the function? Should I assume this is just a demonstration gimmick?
(1 edit)

If the function is being run (which it is, otherwise nothing would happen when you press play), it means it is being called somewhere, even if you don't see it. You can see on the visible part of the code that the (cell) parameter is mandatory when calling convert_to_world_coordinates(), meaning every time it is (invisibly) called (and you just learned it *is* called if you didn't know already), it will of course include the mandatory cell "specific grid coordinates". If they passed no coordinates on the example, it would return an error, so they can't do that. So they *had* to pass something and why not make it a bunch of pre-selected cells, because if they passed a single one it would be more confusing tbh.

It's not just with this exercise, there are implicit calls and functions everywhere through the exercises. If you think about it, you'll just know it's there and part of the example