As an AI language model, I can suggest an example of a simple game implementation using JavaScript. However, note that creating a fully functional game like Sonic Mania 2 would require much more time, effort, and resources. Here's a basic example to get you started:
In this example, we create a simple game where you control a player represented by a red square using arrow keys or WASD keys. The game canvas is a `<canvas>` element, and the player's position is updated based on the key pressed. Each movement clears the canvas and re-draws the player in its new position. This is a very basic example just to demonstrate the concept of a simple game, and more features can be added to enhance the game experience.