mardi 3 novembre 2015

Creating a Haunted House [on hold]

I'm learning to program in java on my own. The book I'm learning from has a project that ask you to create a simple haunted house. I've pasted the instructions below I have an idea of what to do but don't know exactly how to start it. Can some one please help?!?!

The user always starts the game at the front door and must immediately decide where they want to go. Your movement constraints are as follows: • From the front door, the user must choose between going into the living room, dining room or up the stairs. • To get from one room to the next, there must be a door. That means that to get to some rooms, the user must go through other rooms. See the above diagram for more details. • If the user is in a room that is attached to another room via a door (not the one they just came in—no backtracking! ), the user must be given the option between going to the other room or exploring an item in the current room. • If the user is in a room that has no other exit, then they must be given the option between exploring the items in the room.

Here are the possible outcomes for exploring items in each room:

Floor Room Item(s) Outcome 1 Living Room Chest Ghost escapes and scares you to death 1 Dining Room Candelabra Light up by themselves and see a death shadow 1 Kitchen Refrigerator Open it and find some delicious soul food 1 Kitchen Cabinet The dishes and glasses start flying at you as soon as you open the door. You get hit in the head and feel yourself start moving towards a light 1 Pantry Dusty recipe box You open it up and a recipe for chocolate devils food cake appears our of no where 1 Pantry Broom Flies up in the air as soon as you touch it 1 Bathroom Mirror See a bloody face looking back at you 1 Bathroom Shower Room suddenly steams up and you feel fingers touching the back of your neck 2 Bedroom 1 Rocking Chair Chair starts rocking by itself with no one in it 2 Bedroom 1 Window See a child outside on a swing who suddenly disappears 2 Bedroom 2 Doll House The dolls start dancing on their own 2 Bedroom 2 Dresser A ghost flies out of the dresser as soon as you open it and goes right though your body 2 Master Bedroom Jewelry Box You find the cursed Hope Diamond and feel your doom 2 Master Bathroom Intricate Oil Lamp Rub the lamp and a genie pops out who says he’ll grant you 3 wishes 2 Master Bathroom Shower Suddenly hear singing in the shower, but no one is there 2 Bathroom Mirror See a bloody face looking back at you 2 Bathroom Shower Room suddenly steams up and you feel fingers touching the back of your neck

Program Flow: • Ask the user to enter their name so that you can personalize their experience. You will want to use their name as they move through the house and make decisions • Start at the front door as described above. • Each time the user moves to a new room, you must then ask the user what he or she wants to do next. The options available are derived above. Note that there are sometimes more that 2 options available. • Should the user reach a room where there is no other exit, they must select an object to explore. • Once the object is explored, the game is over. This should be indicated clearly to the user.

Aucun commentaire:

Enregistrer un commentaire