Explore BrainMass

Creating a Web Page including a Game

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

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:


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.

© BrainMass Inc. brainmass.com October 25, 2018, 5:11 am ad1c9bdddf

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 ...

Solution Summary

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

See Also This Related BrainMass Solution

An Example of Basic HTML Formatting Elements

See the attached file.
Prepare an HTML document using Microsoft® Notepad, focusing on a concept relevant to this course. Begin by choosing a topic of interest. Brainstorm or outline important concepts related to the chosen topic. Structure your Web page to incorporate the following HTML elements:

Please put both the HTML tag and the topic combined.

Topic: Should L.A Lakers trade Kobe Bryant?

You can make up any paragraph you want.

? Title
? Headings of three different sizes
? Two instances of bold
? Two instances of italics
? Two instances of a horizontal rule
? One list: ordered, un-ordered, or definition
? Two paragraphs of text related to course content
? Two attributes applied to an HTML element, such as alignment and/or color.

View Full Posting Details