MIC
Pat O'Sullivan
Department of Mathematics and Computer Studies
Mary Immaculate College, Limerick, Ireland

General Information

Student Resources and Information

Interests

Interactive Adventure Stories

The basic idea behind the construction of an interactive adventure story is to firstly outline some dilemma (using the label command) offering the reader some options. Each option will be the name of a procedure. Each procedure will similarly offer options linked with clues until the reader arrives at some "destination" procedure which will then terminate the story either with success or failure.
You can (should) incorporate graphics and sound into the story line.
Below I have translated a simple example into Java. I can't get the sound the work.
The procedure that starts the ball rolling is called story. Type the word story into the text box below press ENTER:

The procedures used are:

to story
cs pu fd 150 rt 90 bk 200
label [Welcome to my adventure.] move
label [There is a major bank robbery about to take place in an Irish town.] move
label [ From our intelligence so far we believe that the town in question] move
label [ is either Limerick or Cork] move move
label [Which of these towns would you like to go to?] move
end
to Limerick
cs pu fd 150 lt 90 fd 300 rt 180
Label [As you walk down O'Connel Street a well known police stoolie whispers] move move
label [in your ear:] move label [you should have a chat with Fr. Matthew!] move move
label[ There are two busses just about to leave the station. One is ] move
label[going to Cork and one is going to Dublin. Which one will you take?]
end
to Dublin
playwave "ak-wrong.wav 0
cs pu fd 150 lt 90 fd 300 rt 180
label[You should go to the zoo] move
label [There are lots of other monkeys there!!] move move
label[The bank has been robbed!!!]
playwave "boooo.wav 0
end
to Cork
playwave "applause.wav 0
cs pu fd 250 lt 90 fd 300 rt 180
label [An excellent choice] move
label [Cork is a beautiful city but as you walk down Patrick street ] move
label [you hear some Dublin accents. You decide to follow the men] move
label[in question. They go up a laneway and into a house.] move
label[You look in a window. This is what you see!]
lt 90 pu bk 100 rt 90 fd 300 lt 90 pd cistin pu
lt 90 fd 300 rt 180 pd
label [The men are looking at some video clips on the television.] move
label [They seem to be looking at a statue and saying something about "match you"] move
label [You overhear one of them saying "Dublin" and the other "Lee"] move
label [Where will you go to, Dublin or the Lee?]
end
to lee
playwave "away!.wav 0
cs pu fd 250 lt 90 fd 300 rt 180
label [Well done] move
label [You spotted the robbers entering the door of the AIB by the Fr. Matthew statue] move
label [in Patrick St. You arrived on time to stop and arrest them!] move move
playwave "handcuff.wav 0
label [You have saved the banks of the brown lovely Lee] move move
label [Farewell.]
playwave "applause.wav 1
banks
end
to banks
sound[587 500] wait 1 sound[587 250] wait 1 sound[587 1000]
wait 1
sound[554 500] wait 1 sound[587 500] wait 1 sound[740 500] wait 1 sound[659 500]
wait 1 sound[740 500] wait 1 sound [784 1000]
end
to cistin
move1
rchair
move2
lchair
move3
table
move4
telly
move5
end
to lchair
fd 25 lt 90 fd 20 rt 90 fd 25 bk 50 pu rt 90 fd 25 lt 90 pd
end
to rchair
fd 25 rt 90 fd 25 lt 90 fd 25 bk 50 pu lt 90 fd 25 rt 90 pd
end
to table
fd 50 lt 90 fd 15 bk 80 fd 15 lt 90 fd 50 rt 90 pu fd 50 rt 90 pd
end
to telly
repeat 4[fd 20 rt 90]
pu rt 90 fd 3 lt 90 fd 3 pd
repeat 4[fd 14 rt 90]
pu fd 17 rt 90 fd 7 lt 135 pd fd 20 bk 20 rt 90 fd 20 bk 20
end
to move
pu lt 90 bk 20 rt 90 pd
end
to move1
pu rt 90 fd 50 lt 90 pd
end
to move2
pu lt 90 fd 100 rt 90 pd
end
to move3
pu rt 90 fd 25 lt 90 pd
end
to move4
fd 50 rt 90 fd 15 lt 90
end
to move5
lt 45 pu bk 70
end

The wav files that I use above (and don't work with the Java applet) are:

Right click on a link and select "Save Target As..."

 
Department Home
Home
The information found on personal pages should not be considered official material from Mary Immaculate College and the College does not accept any responsibility for its accuracy or otherwise.