Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
This is the code:
var pnt = mapToItem(player, food.x, food.y);
I'm getting Reference Error: mapToItem is not defined. I guess I have to include something, but I'm not sure what and where?
mapToItem() is a function of Item component - so you need to specify an object. Example:
mapToItem()
Item
Rectangle { id: foo } function getPoint() { let pnt = foo.mapToItem(player, food.x, food.y) return pnt }