The bats move around automatically. The beetle moves forward when you press the up arrow, and turns with the arrows. When you touch the apple, it moves and your score goes up. When you touch a bat, your health goes down.
I made this project in 30 minutes while teaching a coding class. I did not work hard on it at all, It is as begginer level as possible. That is why it is not high-quality.