You move the apple with the arrow sprites. Meanwhile the little mouse sprite continually reports and updates the apple's x, y location on the grid. The code makes use of the fabulous attribute reporter which is in the Sensing palette. It's important for the coder to add the name of the apple (second person sprite) to the mouse sprite's (first person sprite) drop list. Otherwise none of the apple's attributes will appear in the mouse drop list, that includes the apple's x and y positions. The concept of one sprite reporting the attributes of another sprite, is an essential element of graphs, where there is a dependency between a domain (x) and a range (f(x)). It is also used in the Pythagoras code and in several areas of Secondary level maths.
The original version (2017) moved the Apple with the keyboard. This version is touchscreen-friendly. By Seamus O'Neill, Scratch3_RSC and readysteadycode