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

General Information

Student Resources and Information

Interests

Personalised Interactive Adventure Stories

This page is almost identical to the first page on interactive LOGO stories. The only difference is the introduction of an element of personalisation.
The idea is to allow the user to supply a name and then to address the user by name at a few points in the story.
We get a name from the user by using the readlist command.
This command causes an input box to be launched. This box will have two buttons with the captions "Okay" and "Cancel" respectively. The Cancel button simply closes the input box. When the Okay button is pressed, however, readlist outputs a list made from whatever has been typed into the input box.
If, for instance, we write make "ainm questionbox[Introduction][What is your name?] then :ainm will become equal to whatever is output by questionbox.
Assuming that :ainm is now the name of the user we can incorporate this into a sentence using the sentence command.
For instance we can have a command such as label (sentence [Hello] :ainm [Welcome to my story.])
In my Java driven LOGO simulation below I have included the questionbox command and used the user's name in one place.
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
make "ainm questionbox [Introduction][What is your name?]
label (sentence :ainm [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.