back to projects page

Project 3

The Legend of Zelba

Concepts Covered: Writing a large program consisting of several smaller files, Inheritance, Polymorphism

Due: Tuesday, February 25 at midnight

Files you need: MapSpace.java, Mountain.java, Desert.java, sampleMap

Turn In: Map.java, Link.java, MapSpace.java, (VariousMapSpaces).java, LegendOfZelba.java

Background: If you're into video games like I am, there is no doubt that you've played one of Nintendo's fantastic Legend of Zelda games! I can safely say that my favorite game of all time is Legend of Zelda: The Ocarina of Time for the Nintendo 64. For those of you that are not familiar with the game, you play as Link, the hero, and you are generally on some sort of quest. In some of the games your quest is to save the Princess Zelda from the vile clutches of Gannon. In the game, you basically travel throughout Hyrule (the land where the game is based) and get into various adventures on your way to the goal. Most of these adventures involve solving puzzles, fighting monsters, finding items, etc. Your job is to write an extraordinarily simplified version of this game.

Requirements: The simple premise of our version of the game (which will be called the Legend of Zelba to avoid any lawsuits over "intellectual property") will be the following: Link is traveling through Hyrule (which will be represented by a 2D array of objects implementing the MapSpace interface) trying to save Zelba who is at a randomly generated position of the map.

Each space on the map will implement the MapSpace interface, which consists of three methods : onLanding(), onLeaving() and getName(). Your main program (LegendOfZelba.java) will create the Map, create a Link object and then repeatedly let Link move either north, south, east, or west, calling the OnLeaving() method of the MapSpace on which he is leaving and the OnLanding() method of the MapSpace on which he lands. If he makes it to the space that Zelba is located, then you win! Of course, there has to be some way that Link can lose as well, so the Link class has an instance variable called health. His health can be lost throughout the game in various places.

You should think of this game as a piece of interactive fiction. Make your descriptions detailed - attempt to immerse the player into the experience as much as possible. If you've never actually played any interactive fiction before, I highly recommend that you try out The Hitchhikers Guide to the Galaxy. I spent many many hours playing this game when I was younger - but I was never able to beat it. (Note that you have to scroll down to the bottom of the page and enter the number from the screen to start playing it).

Implementation Details: You should probably write the classes in the following order, and test each one thoroughly (write a simple test program that tests all of the methods) before moving on to the next.

Grading: This is an opportunity to earn a massive amount of project extra credit. Implementing the minimum requirements above will make you eligible for full credit for the project. If you go beyond the minimum requirements, you can earn up to 150%! You can add any play mechanic to the game that you would like, but the more complex it is, the more extra credit you can earn. Here are some ideas:

Implementing one or two of these very well would be sufficient for a significant amount of extra credit. You may also be as creative as you wish and add any game mechanic that you can think of. Make sure all of your extra mechanics are documented in your README file, so I know to look for them in your code.

Things to watch out for: