Some web pages are written in a comibination


Some web pages are written in a comibination of HTML and JavaScript. In this Application, you will create a video game using HTML and JavaScript. The idea of the game is that an image will move on screen randomly and the player will try to click the image as many times as possible before time runs out. The score will increase each time the player successfully clicks the image.

Perform the following steps:

1. Create a Web page called "game.html" and place it in the root directory. To that page, add a layer, which will be treated as an object, with an image for its contents. Add another image which will start the game when clicked on. When the game starts, the layer, including the image, will move randomly in any direction but not more than 10 pixels. The layer will not leave the visible screen space. You may assume an 800x600 resolution setting. Be creative when choosing your images, but avoid anything that may be considered explicit or offensive.

2. Add a timer, or loop, to determine how long the game will run. This should be set to 30 seconds. You will need to experiment to determine how many times a loop must repeat to make it last 30 seconds. One of the ways to accomplish this is by using the command "setTimeout()" which executes a code some time in the future. As an example, the following command will call the function "FlyLogoIE" exactly 50 milliseconds after this line is executed:

setTimeout("FlyLogoIE()",50);

3. The game should proceed as follows:

a. The score starts at 0. Each time the user clicks the image, one point is added to the score. This score is constantly displayed either on the status bar or somewhere in the background.

b. On every click, the layer also moves randomly, by not more than 10 pixels, to another part of the screen.

c. The game continues until the time runs out. Optionally, a dialog box appears telling the user his or her final score. The user now has the option to restart the game by clicking the "Start" image again.

4. For an extra challenge, implement levels of difficulty for the game. Add instructions that prompt the user for the level of difficulty at which he or she wants to play. A higher level of difficulty would correspond to either faster motion, a smaller target, or both. Perform this step only if all other requirements are met and you still have time before the due date. No extra points will be given to you for this step.

5. Add a link from your homepage to this web page.  

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Some web pages are written in a comibination
Reference No:- TGS081839

Expected delivery within 24 Hours