Purchase Solution

Creating a Web Page including a Game

Not what you're looking for?

Ask Custom Question

Create a Web page called "game.html" and add a layer to it, 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.

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 "FlyLogo" exactly 50 milliseconds after this line is executed:

setTimeout("FlyLogoIE()",50);

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.

Purchase this Solution

Solution Summary

This solution provides a tutorial on the given Web Design project.

Solution Preview

Please find attached the game.html file and two images (imageGame.jpg and imageHit.jpg). I recommend that you find some images on the Internet or ...

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Networking Questions

This quiz consists of some basic networking questions.