Sure! Here's an example of a simple game using JavaScript that meets your requirements:
This code creates a game board with a player box in blue and an enemy box in red. The player can be controlled using the arrow keys on a keyboard or by swiping gestures on a smartphone. The enemy moves randomly in one of the four directions every second. If the player and enemy collide, a game over alert is shown, and the game is reset.
Please note that the game logic provided here is just a basic example. You can further enhance it according to your requirements and style preferences.