Create a game using the following rules:
Two players play the game. Each player takes a turn that lasts 30 seconds. On each turn, the player is to "tag" an asterisk(*) on the screen that starts on the left-hand side of the screen and travels across the screen and back. The asterisk begins at the far left of the screen and travels across ten different points on the screen until it rach the far right side of the screen, then return to the left of the screen. The player "tags" the asterisk by clicking a button or clicking text "Tag". The further the asterisk is to the right of the screen, the more points are scored when a player "tags" the asterisk. When the asterisk is "tagged" the player receives the point value associated with the position on the screen. Each point value shoul dbe clearly displayed next to its position.
The game is started when a "start" button or text(as in a P tag) is clicked. The game should go for 5 turns each player, then end and display the winner. It should be clear at all times whose turn it is: player 1 or player 2. You can restart the game by either refreshing the browser, or clicking a "new game" button, then clicking "start".
When the browser loads, the asterisks will start at the left-hand side of the screen and travel 10 positions to the right and then travels 10 positions back. Position 1 is worth 1 point, poistion 2 is worth 2 points, etc. up to position 10 which is worth 10 points. The player must click the "Tag" button to get points, so it is worth more point to click the button the further to the right the asterisk is. The goal is to get the most points within 30 seconds.
Hints:
* Use a one second timer to count down the game time(30 seconds per turn)
* Use a faster timer to change the position of the asterisks
* Use P tag or DIV tags to hold and update the score for each player
Optional (worth 25 points of Extra Credit each)
* Allow the players to set the difficulty level from one to three, which controls the speed of the asterisks
* Allow the players to select normal play - or random play, in which the asterisk is randomly positioned across the screen.
Bookmarks