Sure! Here's an example of a simple game based on Undertale implemented as a single HTML file:
This game sets up a canvas on the web page and allows the player to control a green square (representing the player) using the arrow keys. The player can move around the canvas, and the game loop continuously updates the player's position and redraws the canvas.
This is a very simple example, and you can build upon it to add game logic, interactions with other characters, dialogues, and any other features you want to include to make it resemble Undertale.