Sure! Here's a sample implementation of a game using HTML and JavaScript that meets your requirements:
😀
In this game, you start with an emoji in the middle of the screen. You can use the right and left arrow keys to move the emoji horizontally, the up and down arrow keys to move it vertically, and the spacebar to transform the emoji into a dragon and vice versa. The emoji/dragon will be displayed in the middle of the screen.
Note: This is just a simple example to demonstrate the functionality you described. You can enhance the game further by adding levels, obstacles, and more interactions.