CSCI 470
Web Science
Spring 2015

Montana Tech
Computer Science & Software Engineering



Gem Dungeon

You will be building an online game in which players roam a dungeon collecting gems. This week we will be building a single-player verison of the game. You will learn to use the HTML5 Canvas element and the Web Audio API.


Overview.
The login page of the game allows users to create a player with a given name, choose their player's image, and choose a dungeon to play in. The player is then assigned a random position in the dungeon. The player navigates through the dungeon by pressing the arrow keys. The player can type short messages that appear temporarily below the player. The player tries to collect gems that have been randomly placed around the dungeon. You should implement your web page using HTML5, JavaScript, and the <canvas> element.

Files. The file dungeon.zip has the images and audio files for the assignment. It also contains a completed version of the login page and a partially completed version of the game page.

We have provided you with a set of dungeon?.txt files that define dungeons of different sizes. Here is a small example:
13 10
8
W W W W W W W W W W W W W
W - W - - - - - - D - - W
W - W - W W W - W W - - W
W - W - D - D - W W - - W
W - - - W W W - W W W S W
W W W - W W W D W W - - W
W W W - W - - - - D - - W
W W W - S - - - - W - - W
W - - - W W W W W W - - W
W W W W W W W W W W W W W
The first line has two integers which specify the width and height (respectively) of the dungeon in tiles. The second line is a integer specifying how many gems are located in the dungeon. The rest of the file defines the layout of the dungeon. The "W" character denote walls, the "D" character denotes doors, the dash "-" character denotes passageways, and "S" denotes a secret passageway. Secret passageways look like a wall but you can walk through them nonetheless. The provided PHP function getDungeonJSON($filename) can be used to create a JavaScript array containing data about the dungeon.

Requirements:
Submission. I will be testing your program on the URL given in the header of your source code. I will be using the Firefox browser. You also need to submit your source file(s) to the Moodle dropbox. The Moodle timestamp is the completion time for the assignment.

Page last updated: March 23, 2015