CSCI 446 Unit #12 JS Same Game
Specific Requirements
This assignment is worth 40 points. Requirements:
- (2) Page layout with game board, score, reset button
- (4) Board displays with specified number of colors
- (2) Colors are randomly assigned
- When square is clicked:
- (1) if no adjacent squares of same color, no action
- (4) if adjacent (up/down/left/right - no diagonal) tile color
matches:
- (2) remove all connected squares (i.e., matched tiles turn black)
- (2) tiles above move down to fill space
- (4) if an entire column is empty, tiles move to left
- (3) score is updated and displayed using formula:
score += (num_tiles_just_removed * (num_tiles_just_removed - 1)
. E.g., if 3 tiles are removed, add 6 to score (3*2). If 10 tiles
are deleted, add 90 to score (10*9). etc.
- Check for game over:
- (4) if there are no remaining tiles, player wins (display message)
- (4) if there are no remaining adjacent cells of same color, player
loses (display message)
- (4) Reset button resets score to 0, redisplays board with new colors, etc.
Ease of grading criteria.
- (1) Create a zip file with your html, css and image files.
- (3) to make it easy to test game over, include a var named numColors
var at top of js file. The grader will test this set to 4
(normal operation) and 2 (to make it easy to win/lose).
Submit
Submit your zip on Canvas