This is a basic setup of a mechanic. It enables the sprite to collect an item, hold onto it, and choose to place it if the sprite interacts with another sprite. This could be useful if any of us are making a game project.
Use the arrows to move. Collect the apple and either place it in the basket or don't. Press the flag to restart.