Sure, here's a simple playable sample game in HTML with JavaScript where you can control Sonic in a 3D environment and fight against Eggman:
In this game, Sonic is represented by a blue square and Eggman is represented by a red square. You can control Sonic's movements using the arrow keys on your smartphone. The objective is to move Sonic towards Eggman and catch him. If Sonic's position overlaps with Eggman's, an alert will be shown indicating that you caught Eggman, ending the game.