Sure! Here's an example of a simple game where you play as a rat and try to eat apples to expand your tail while avoiding bananas. The game will be implemented as a single HTML file with JavaScript enclosed in script tags.
You can save the above code in a file with a `.html` extension and open it in a web browser to play the game. The game canvas will display a gray square representing the rat, red squares representing apples, and yellow squares representing bananas. Use the arrow keys to control the rat and try to eat apples to expand your tail while avoiding bananas. Enjoy the game!