Creating a simple game with javascript


The assigment is all about the Web design. Please follow all the instructions illustrated below.

Instruction: Need 3 separated files.html, css, js

Please write simple code and add comments.

For this assignment, you will create a simple game with JavaScript (and jQuery and Raphaël).

The Game:

If I've learned anything from the kinds of games people play on their phones, it's that everybody loves clicking little shapes to make them disappear. Let's do that.

We will draw a game area (a Raphaël paper object) let the user choose their difficulty, and which shape they want to appear. When they start the game, several shapes appear randomly on the board and move in random directions.

As they click the shapes, they will disappear (be “zapped”). The goal is to zap as many as possible.

Video: https://www.youtube.com/watch?v=fiWhAHx2TW8

Requirements:

For this assignment, you must use Raphaël to create a game area. When the user selects their options for the game and clicks a button, they should see some shapes appear, and be able to click them to zap them.

Requirements for the game:

a) A choice of “difficulty” as a text input. Higher numbers are harder. Style the input (CSS width property) so it's a reasonable size.

b) The way the game becomes “difficult” is up to you, but some options: more shapes; smaller shapes; faster shapes; less time to zap them.

c) A selector where the player can choose the shape they want added to the game, with at least three options.

d) At least one of the shapes must be drawn with as a .path (not one of the built-in shapes Raphaël will draw for you).

e) The shapes appear at random locations and move in random directions (i.e. towards a random point).

f) Count the score: the number of shapes “zapped” to make them disappear, and the number that “escape”.

g) Make it look nice. Make it fun.

Suggested Plan:

Break your game's behaviour down into chunks, instead of trying to tackle the whole thing at once. Work on one chunk at a time, and make sure it's working before you move on.

A suggestion:

1) Create the game board, and get (several of) one kind of shape drawing when the button is clicked.

2) Add other options of shape.

3) Animate the shapes so they move when they are created.

4) Make the shapes disappear when the animation is over.

5) Make the shapes disappear when they are clicked.

6) Count the score.

7) Fiddle with the game difficulty so it's fun to play.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Creating a simple game with javascript
Reference No:- TGS01238330

Expected delivery within 24 Hours