Sure! Here's a complete game that alternates the color of a ball between black and white every one second. The game is implemented as a single HTML file with JavaScript, enclosed in script tags:
When you open this HTML file in a web browser (preferably on a smartphone), it will display a ball that starts switching colors between black and white every one second. The ball is represented using a div element with id "ball". You can customize the size and appearance of the ball by modifying the CSS styles in the `<style>` tag.
Feel free to copy this code into a new HTML file and test it out as a finished game on your smartphone. Enjoy!