HTW Berlin Medieninformatik HTW Berlin
Fachbereich 4
Internationaler Studiengang
Internationale Medieninformatik (Bachelor)
Info 1: Informatik I
Winter Term 2022/23

Laboratory 10: The World of You

Pre-lab

This week's lab work will begin a larger project that will occupy us until the end of the semester. You will be working with the same partner for the next three exercises. You can choose who you want to work with and prepare your game scenario together. Or you can make a scenario alone, and then decide with your partner which game you will be implementing.

What to Bring to Lab

Please bring these exercises printed out or written out with you to lab. Please have your name on your page.

P1. Design your own game scenario away from the computer. Don't worry about implementation or classes or programming. Just try and come up with something interesting. It needs to be the basic structure of a player moving through different locations. Possible examples:

Be creative! Give your game a name.

P2. What is the goal of your game, that is, when does the player win?

P3. What could you add to the game to make it interesting? Trap doors, treasure, monsters, .....

P4. Draw a map of your game layout.

Post-Lab, AKA  What To Turn In

Your completed assignment, submitted in Moodle as a pdf, should include:

Lab assignments are due the night before the next lab at 22.00, I want you to get some sleep the night before the next class. They may, of course, be turned in earlier. You hand them in by preparing the report in PDF and submitting it to Moodle.


Assignment

World of You

  1. Start with the bad Zuul game and refactor it as discussed in the lectures. If you are doing mole burrows instead of rooms, you can change the variable names as needed. The bored can prepare a multi-lingual version and use enums.
  2. Draw an object diagram showing the state of your system just after it has been started. Does it change if you issue a "go" command?
  3. Add a "look" command to your game.
  4. Add an additional command (such as "eat", which for now just prints out "You have eaten now and are not hungry any more"). In the next exercise, when we have added items, you can make it so that you can only eat if you have found food.
  5. Implement an improved version of printing out the command words.
  6. Add another command that fits your game—did you have to change the Game class? Why or why not?
  7. (For the bored) What is the model-view-controller pattern? Adapt your code to follow this pattern.

Writeup

Submit your writeup as your post-lab to the Moodle area by 22.00 the night before your next lab.

 


Copyright Prof. Dr. Debora Weber-Wulff
Questions or comments: <weberwu@htw-berlin.de>
Some rights reserved. CC-BY-NC-SA - Copyright and Warranty

The exercises are adapted from Objects First with Java, A Practical Introduction Using BlueJ. David Barnes & Michael Kölling, 2016