Microsoft Small Basic

Program Listing: LVV740
GraphicsWindow.Title = "脱出ゲーム"
GraphicsWindow.Width = 640
GraphicsWindow.Height = 480
GraphicsWindow.CanResize = "False"

mojicolor = "White"
bgcolor = "Black"

GraphicsWindow.FontName = "Meiryo UI"
GraphicsWindow.FontSize = 60
GraphicsWindow.BackgroundColor = "CadetBlue"
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(180, 50, "脱出ゲーム")
GraphicsWindow.FontSize = 16
GraphicsWindow.DrawText(80, 160, "~遊び方~")
GraphicsWindow.DrawText(80, 160+20, "あなたは部屋に閉じ込められました。脱出してください。というゲームです。")
GraphicsWindow.DrawText(80, 160+20*2, "この画面以外は、基本的にマウスクリックで遊びます。")
GraphicsWindow.DrawText(80, 160+20*3, "気になる場所をクリックして調べてください。")
GraphicsWindow.DrawText(80, 160+20*4, "メッセージウィンドウに")
GraphicsWindow.FontName = "Wingdings 3"
GraphicsWindow.BrushColor = "black"
mihonbutton = Controls.AddButton("u", 200, 160+20*5+5)
GraphicsWindow.FontName = "Meiryo UI"
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(80, 160+20*7, "こんなボタンが出ている時は、メッセージに続きがありますから、")
GraphicsWindow.DrawText(80, 160+20*8, "ボタンを押して続きを読んでください。")
GraphicsWindow.DrawText(80, 160+20*9, "あるところでは、数字を入力しなければなりませんが、")
GraphicsWindow.DrawText(80, 160+20*10, "その時は半角数字で入力してください。")

GraphicsWindow.FontSize = 20
GraphicsWindow.DrawText(160, 400, "Spaceキーを押すとゲームを開始します。")

GraphicsWindow.FontSize = 16
GraphicsWindow.BrushColor = "black"

'ボタン設置
kaisibutton = Controls.AddButton("探索開始", 350, 430)
migibutton = Controls.AddButton("部屋の右側の探索→", 460, 260)
hidaributton = Controls.AddButton("←部屋の左側の探索", 10, 260)
kinkoYes = Controls.AddButton("やってみる", 290, 400)
kinkoNo = Controls.AddButton("やめる", 290, 430)
kinkobutton = Controls.AddButton("ダイアルを合わせる", 300, 400)
kinko = Controls.AddTextBox(270, 370)
GraphicsWindow.FontName = "Wingdings 3"
OPkaiwa1 = Controls.AddButton("u", 380, 430)
OPkaiwa2 = Controls.AddButton("u", 380, 430)
hikidasi1 = Controls.AddButton("u", 380, 430)
gomibako1 = Controls.AddButton("u", 380, 430)
gomibako2 = Controls.AddButton("u", 380, 430)
end1 = Controls.AddButton("u", 380, 430)
tv1 = Controls.AddButton("u", 380, 430)
tv2 = Controls.AddButton("u", 380, 430)
tv3 = Controls.AddButton("u", 380, 430)
kamikire1 = Controls.AddButton("u", 380, 430)
pic1 = Controls.AddButton("u", 380, 430)
pic2 = Controls.AddButton("u", 380, 430)

GraphicsWindow.FontName = "Meiryo UI"

'ボタンを一時的に非表示
Controls.HideControl(kaisibutton)
Controls.HideControl(migibutton)
Controls.HideControl(hidaributton)
Controls.HideControl(OPkaiwa1)
Controls.HideControl(OPkaiwa2)
Controls.HideControl(hikidasi1)
Controls.HideControl(kinkoYes)
Controls.HideControl(kinkoNo)
Controls.HideControl(kinkobutton)
Controls.HideControl(kinko)
Controls.HideControl(gomibako1)
Controls.HideControl(gomibako2)
Controls.HideControl(end1)
Controls.HideControl(tv1)
Controls.HideControl(tv2)
Controls.HideControl(tv3)
Controls.HideControl(kamikire1)
Controls.HideControl(pic1)
Controls.HideControl(pic2)

kinkoopen = 0 '金庫を開けたか開けてないか。開けてない時は0、金庫を開けたら1

'スペースキーを押した直後
GraphicsWindow.KeyDown = StartKey
Sub StartKey
If GraphicsWindow.LastKey = "Space" Then
Controls.HideControl(mihonbutton)
GraphicsWindow.BackgroundColor = bgcolor
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(0, 0, GraphicsWindow.Width, GraphicsWindow.Height)

'メッセージウィンドウ
GraphicsWindow.PenColor = mojicolor
GraphicsWindow.DrawRectangle(5, 305, 430, 170)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "ここはどこだ?")
Controls.ShowControl(OPkaiwa1)

'アイテム欄
GraphicsWindow.DrawRectangle(445, 305, 190, 170)
GraphicsWindow.BrushColor = "MediumBlue"
GraphicsWindow.FillRectangle(447, 307, 55, 25)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(448, 308, "アイテム")

Controls.ShowControl(OPkaiwa1)
Controls.ButtonClicked = Tansaku
tansakuheya = 1
EndIf
EndSub

'ボタンを押した時のサブルーチン。ボタン押した時はクリック音出す
Sub Tansaku
Sound.PlayClick()
If Controls.LastClickedButton = OPkaiwa1 Then 'オープニング会話1
'部屋の左側背景-----------------------------------

GraphicsWindow.BrushColor = "Cornsilk"
GraphicsWindow.FillRectangle(0, 0, 640, 300)

GraphicsWindow.PenColor = "BurlyWood"
GraphicsWindow.DrawLine(200, 0, 200, 200)
GraphicsWindow.DrawLine(200, 200, 100, 300)
GraphicsWindow.DrawLine(200, 200, 640, 200)

'ドア
GraphicsWindow.BrushColor = "RosyBrown"
GraphicsWindow.FillRectangle(250, 20, 80, 180)
GraphicsWindow.BrushColor = "Bisque"
GraphicsWindow.FillEllipse(315, 110, 10, 10)

'タンス
GraphicsWindow.BrushColor = "Sienna"
GraphicsWindow.FillRectangle(410, 100, 150, 100)
GraphicsWindow.FillRectangle(360, 150, 150, 100)
GraphicsWindow.FillTriangle(410, 100, 360, 150, 410, 150)
GraphicsWindow.FillTriangle(510, 200, 510, 250, 560, 200)
GraphicsWindow.PenColor = "Maroon"
GraphicsWindow.DrawRectangle(360, 150, 150, 100)
GraphicsWindow.DrawLine(410, 100, 410-50, 100+50)
GraphicsWindow.DrawLine(560, 100, 560-50, 100+50)
GraphicsWindow.DrawLine(560, 200, 560-50, 200+50)
GraphicsWindow.DrawLine(410, 100, 560, 100)
GraphicsWindow.DrawLine(560, 100, 560, 200)
GraphicsWindow.DrawLine(360, 200, 360+150, 200)
GraphicsWindow.BrushColor = "Maroon"
GraphicsWindow.FillEllipse(360+70, 150+70, 10, 10)
GraphicsWindow.FillEllipse(360+70, 150+20, 10, 10)

'ゴミ箱
GraphicsWindow.BrushColor = "Aquamarine"
GraphicsWindow.FillEllipse(130, 220, 30, 20)
GraphicsWindow.FillEllipse(130, 270, 30, 20)
GraphicsWindow.FillRectangle(130, 220+15, 30, 270-220)
GraphicsWindow.PenColor = "DarkCyan"
GraphicsWindow.DrawEllipse(130, 220, 30, 20)

'部屋の左側背景 ここまで-----------------------------------

GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "眠っていたのだろうか。いつの間にか、こんな部屋に居た。")
GraphicsWindow.DrawText(8, 308+30, "見知らぬ部屋だ。さっさと帰ろう。")
Controls.HideControl(OPkaiwa1)
Controls.ShowControl(OPkaiwa2)
EndIf

If Controls.LastClickedButton = OPkaiwa2 Then 'オープニング会話2
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "……ん? このドア、鍵がかかっている。")
GraphicsWindow.DrawText(8, 308+30, "どうなっているんだ。")
GraphicsWindow.DrawText(8, 308+30*2, "部屋を探索してみようか……。")
Controls.HideControl(OPkaiwa2)
Controls.ShowControl(kaisibutton)
EndIf

'以下、変数tansakuheyaで探索している部屋を指定
'tansakuheya = 1 部屋左側探索中
'tansakuheya = 2 部屋左側探索中
'tansakuheya = 0 メッセージ表示中に探索ができないようにする

If Controls.LastClickedButton = kaisibutton Then
tansakuheya = 1
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "気になる場所を、マウスで左クリックしてくれ。")
GraphicsWindow.DrawText(8, 308+30, "「部屋の右側の探索→」を押すと、部屋の右側を探索できる。")
Controls.HideControl(kaisibutton)
Controls.ShowControl(migibutton)
GraphicsWindow.MouseDown = TMouseDown
EndIf

If Controls.LastClickedButton = hidaributton Then '探索している部屋 1=左
tansakuheya = 1
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "部屋の左側を探索しよう。")
Controls.ShowControl(migibutton)
Controls.HideControl(hidaributton)
GraphicsWindow.MouseDown = TMouseDown
'部屋の左側背景-----------------------------------

GraphicsWindow.BrushColor = "Cornsilk"
GraphicsWindow.FillRectangle(0, 0, 640, 300)

GraphicsWindow.PenColor = "BurlyWood"
GraphicsWindow.DrawLine(200, 0, 200, 200)
GraphicsWindow.DrawLine(200, 200, 100, 300)
GraphicsWindow.DrawLine(200, 200, 640, 200)

'ドア
GraphicsWindow.BrushColor = "RosyBrown"
GraphicsWindow.FillRectangle(250, 20, 80, 180)
GraphicsWindow.BrushColor = "Bisque"
GraphicsWindow.FillEllipse(315, 110, 10, 10)

'タンス
GraphicsWindow.BrushColor = "Sienna"
GraphicsWindow.FillRectangle(410, 100, 150, 100)
GraphicsWindow.FillRectangle(360, 150, 150, 100)
GraphicsWindow.FillTriangle(410, 100, 360, 150, 410, 150)
GraphicsWindow.FillTriangle(510, 200, 510, 250, 560, 200)
GraphicsWindow.PenColor = "Maroon"
GraphicsWindow.DrawRectangle(360, 150, 150, 100)
GraphicsWindow.DrawLine(410, 100, 410-50, 100+50)
GraphicsWindow.DrawLine(560, 100, 560-50, 100+50)
GraphicsWindow.DrawLine(560, 200, 560-50, 200+50)
GraphicsWindow.DrawLine(410, 100, 560, 100)
GraphicsWindow.DrawLine(560, 100, 560, 200)
GraphicsWindow.DrawLine(360, 200, 360+150, 200)
GraphicsWindow.BrushColor = "Maroon"
GraphicsWindow.FillEllipse(360+70, 150+70, 10, 10)
GraphicsWindow.FillEllipse(360+70, 150+20, 10, 10)

'ゴミ箱
GraphicsWindow.BrushColor = "Aquamarine"
GraphicsWindow.FillEllipse(130, 220, 30, 20)
GraphicsWindow.FillEllipse(130, 270, 30, 20)
GraphicsWindow.FillRectangle(130, 220+15, 30, 270-220)
GraphicsWindow.PenColor = "DarkCyan"
GraphicsWindow.DrawEllipse(130, 220, 30, 20)

'部屋の左側背景 ここまで-----------------------------------
EndIf

If Controls.LastClickedButton = migibutton Then '探索している部屋 2=右
tansakuheya = 2
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "部屋の右側を探索しよう。")
Controls.HideControl(migibutton)
Controls.ShowControl(hidaributton)
GraphicsWindow.MouseDown = TMouseDown

'部屋の右側背景-----------------------------------
GraphicsWindow.BrushColor = "Cornsilk"
GraphicsWindow.FillRectangle(0, 0, 640, 300)

GraphicsWindow.PenColor = "BurlyWood"
GraphicsWindow.DrawLine(440, 0, 440, 200)
GraphicsWindow.DrawLine(0, 200, 440, 200)
GraphicsWindow.DrawLine(440, 200, 640, 300)

'絵
GraphicsWindow.BrushColor = "Goldenrod"
GraphicsWindow.FillRectangle(20, 20, 80, 60)
GraphicsWindow.BrushColor = "Snow"
GraphicsWindow.FillRectangle(25, 25, 70, 50)
GraphicsWindow.BrushColor = "PaleGreen"
GraphicsWindow.FillRectangle(30, 30, 40, 15)
GraphicsWindow.BrushColor = "PeachPuff"
GraphicsWindow.FillEllipse(30, 50, 10, 10)
GraphicsWindow.BrushColor = "SkyBlue"
GraphicsWindow.FillEllipse(70, 40, 20, 20)
GraphicsWindow.PenColor = "DarkSalmon"
GraphicsWindow.DrawTriangle(40, 50, 90, 60, 50, 70)

'テレビ下の紙切れ
GraphicsWindow.BrushColor = "Gainsboro"
GraphicsWindow.FillTriangle(240, 220, 248, 230, 260, 220)

'テレビ
GraphicsWindow.PenColor = "DimGray"
GraphicsWindow.DrawRectangle(140, 50, 180, 150)
GraphicsWindow.BrushColor = "SlateGray"
GraphicsWindow.FillRectangle(140, 50, 180, 150)
GraphicsWindow.FillRectangle(160, 70, 180, 150)
GraphicsWindow.FillTriangle(140, 50+150, 160, 70+150, 160, 140)
GraphicsWindow.FillTriangle(140+200-20, 50, 140+200-20, 70, 140+200, 70)
GraphicsWindow.BrushColor = "DimGray"
GraphicsWindow.FillRectangle(140+20+10, 50+20+10, 160, 100)
GraphicsWindow.PenColor = "DimGray"
GraphicsWindow.DrawRectangle(160, 70, 180, 150)
GraphicsWindow.DrawLine(140, 50, 160, 70)
GraphicsWindow.DrawLine(140, 50+150, 160, 70+150)
GraphicsWindow.DrawLine(140+180, 50, 160+180, 70)

'窓
GraphicsWindow.BrushColor = "Beige"
GraphicsWindow.FillTriangle(440+50, 20, 440+50+100, 20+50, 440+50+100, 20+50+50)
GraphicsWindow.FillTriangle(440+50, 20, 440+50+100, 20+50+50, 440+50, 20+50)
GraphicsWindow.PenColor = "Tan"
GraphicsWindow.DrawLine(440+50, 20, 440+50+100, 20+50)
GraphicsWindow.DrawLine(440+50, 20+50, 440+50+100, 20+50+50)
GraphicsWindow.DrawLine(440+50, 20, 440+50, 20+50)
GraphicsWindow.DrawLine(440+50+50, 20+25, 440+50+50, 20+50+25)
GraphicsWindow.DrawLine(440+50+100, 20+50, 440+50+100, 20+50+50)

'部屋の右側背景ここまで-----------------------------------
EndIf

'タンス調査時セリフ
If Controls.LastClickedButton = hikidasi1 Then '探索している部屋 1=左
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "下の引き出しに、金属製の小さな金庫が入っていた。")
GraphicsWindow.DrawText(8, 308+30, "ダイアル式の錠前が付いている。")
GraphicsWindow.DrawText(8, 308+30*2, "ダイアルの数字を合わせてみようか?")
Controls.HideControl(hikidasi1)
Controls.ShowControl(kinkoYes)
Controls.ShowControl(kinkoNo)
EndIf

If Controls.LastClickedButton = kinkoYes Then '探索している部屋 1=左
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "数字を半角数字で入力し、")
GraphicsWindow.DrawText(8, 308+30, "「ダイアルを合わせる」のボタンを押してください。")
Controls.ShowControl(kinkobutton)
Controls.ShowControl(kinko)
Controls.HideControl(kinkoYes)
Controls.HideControl(kinkoNo)
EndIf

If Controls.LastClickedButton = kinkoNo Then '探索している部屋 1=左
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "やめて、部屋の探索に戻ろう。")
Controls.HideControl(kinkoYes)
Controls.HideControl(kinkoNo)
Controls.ShowControl(migibutton)
tansakuheya = 1
EndIf

If Controls.LastClickedButton = kinkobutton Then '探索している部屋 1=左
If Controls.GetTextBoxText(kinko) = "5609" Then
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "金庫が開いた!")
GraphicsWindow.DrawText(8, 308+30, "中にはメモがある。")
GraphicsWindow.DrawText(8, 308+30*2, "「遥か底の裏に真相がある」")
GraphicsWindow.DrawText(8, 308+30*3, "何のことだ? もう一度、部屋を調べなおしてみようか。")
kinkoopen = 1 '金庫開けたフラグ
Controls.HideControl(kinkobutton)
Controls.HideControl(kinko)
Controls.ShowControl(migibutton)
tansakuheya = 1
Else
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "開かない……。")
GraphicsWindow.DrawText(8, 308+30, "どこかに、何の数字を入力するかヒントがあるかもしれない。")
GraphicsWindow.DrawText(8, 308+30*2, "探してみよう。")
Controls.HideControl(kinkobutton)
Controls.HideControl(kinko)
Controls.ShowControl(migibutton)
tansakuheya = 1
EndIf
EndIf

'ゴミ箱調査時セリフ / 金庫開けたフラグあり。エンディングへ
If Controls.LastClickedButton = gomibako1 Then '探索している部屋 1=左
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "あっ、あのメモだ。")
GraphicsWindow.DrawText(8, 308+30, "底の裏!")
GraphicsWindow.DrawText(8, 308+30*2, "このゴミ箱のことじゃないか? ひっくり返してみよう。")
Controls.HideControl(gomibako1)
Controls.ShowControl(gomibako2)
EndIf
If Controls.LastClickedButton = gomibako2 Then '探索している部屋 1=左
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "ゴミ箱の底の裏に、鍵がテープで貼り付けてあった。")
GraphicsWindow.DrawText(8, 308+30, "なんて隠し方をするんだよ。")
GraphicsWindow.DrawText(8, 308+30*2, "よし、これでドアを開けてみよう。")
Controls.HideControl(gomibako2)
Controls.ShowControl(end1)
EndIf
If Controls.LastClickedButton = end1 Then '探索している部屋 1=左
GraphicsWindow.BrushColor = "SteelBlue"
GraphicsWindow.FillRectangle(0, 0, 640, 480)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "無事、部屋から出ることができた。")
GraphicsWindow.DrawText(8, 308+30, "部屋から出た私を待ち構えていたのは友人たちだった。")
GraphicsWindow.DrawText(8, 308+30*2, "「誕生日おめでとう!」と。")
GraphicsWindow.DrawText(8, 308+30*3, "サプライズのお祝いだったようだ。。<END>")
Controls.HideControl(end1)
EndIf

'テレビ調査時セリフ
If Controls.LastClickedButton = tv1 Then '探索している部屋 2=右
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "電源を押しても反応がない。")
GraphicsWindow.DrawText(8, 308+30, "テレビの裏側を見ると、")
GraphicsWindow.DrawText(8, 308+30*2, "差込プラグがコンセントに刺さっていない。")
Controls.HideControl(tv1)
Controls.ShowControl(tv2)
EndIf
If Controls.LastClickedButton = tv2 Then '探索している部屋 2=右
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "そもそもこの部屋、")
GraphicsWindow.DrawText(8, 308+30, "コンセントがひとつも見当たらないぞ。")
GraphicsWindow.DrawText(8, 308+30*2, "テレビを置く意味がないじゃないか。")
Controls.HideControl(tv2)
Controls.ShowControl(tv3)
EndIf
If Controls.LastClickedButton = tv3 Then '探索している部屋 2=右
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "ここを調べても無駄だな。")
GraphicsWindow.DrawText(8, 308+30, "他を調べよう。")
Controls.HideControl(tv3)
Controls.ShowControl(hidaributton)
tansakuheya = 2
EndIf

'テレビ下紙切れ調査時セリフ
If Controls.LastClickedButton = kamikire1 Then '探索している部屋 2=右
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "挟まっていたのは紙切れだ。こう書いてある。")
GraphicsWindow.DrawText(8, 308+30, "「しかくの なかの あかい すうじ」")
GraphicsWindow.DrawText(8, 308+30*2, "何のことだろう?")
GraphicsWindow.DrawText(448, 338, "紙切れ")
Controls.HideControl(kamikire1)
Controls.ShowControl(hidaributton)
tansakuheya = 2
EndIf

'絵画調査時セリフ
If Controls.LastClickedButton = pic1 Then '探索している部屋 2=右
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "図形と数字がデタラメに並んでいるようにしか")
GraphicsWindow.DrawText(8, 308+30, "見えないけど、こういうのを抽象画と言うのだろう。")
'絵拡大 ここから-----------------------------------
GraphicsWindow.BrushColor = "Goldenrod"
GraphicsWindow.PenColor = "Goldenrod"
Ewaku = Shapes.AddRectangle(340, 260)
Shapes.Move(Ewaku, 150, 20)
GraphicsWindow.BrushColor = "Snow"
GraphicsWindow.PenColor = "Snow"
Ehaikei = Shapes.AddRectangle(320, 240)
Shapes.Move(Ehaikei, 160, 30)
GraphicsWindow.BrushColor = "PaleGreen"
Emidorisikaku = Shapes.AddRectangle(160, 60)
Shapes.Move(Emidorisikaku, 160+20, 30+20)
GraphicsWindow.BrushColor = "PeachPuff"
EPeachPuffmaru = Shapes.AddEllipse(40, 40)
Shapes.Move(EPeachPuffmaru, 160+20, 30+100)
GraphicsWindow.BrushColor = "SkyBlue"
ESkyBluemaru = Shapes.AddEllipse(80, 80)
Shapes.Move(ESkyBluemaru, 160+180, 30+60)
GraphicsWindow.PenColor = "DarkSalmon"
GraphicsWindow.BrushColor = "Snow"
Esankaku = Shapes.AddTriangle((40-25)*4+160, (50-25)*4+30, (90-25)*4+200, (46-25)*4+110, (50-25)*4+180, (70-25)*4+80)
GraphicsWindow.BrushColor = "Orange"
Emoji[1] = Shapes.AddText("593 897 21 90 1 1 45 01 63 5")
Shapes.Move(Emoji[1], 160+10, 30+90)
GraphicsWindow.BrushColor = "MediumSpringGreen"
Emoji[2] = Shapes.AddText(" 6 484 5 5 5 52 8179 270")
Shapes.Move(Emoji[2], 160+10, 30+90)
GraphicsWindow.BrushColor = "MediumBlue"
Emoji[3] = Shapes.AddText(" 1 6 4 84 2 200")
Shapes.Move(Emoji[3], 160+10, 30+90)
Emoji[4] = Shapes.AddText("9")
Shapes.Move(Emoji[4], 160+100, 30+10)
Emoji[5] = Shapes.AddText("1")
Shapes.Move(Emoji[5], 160+100, 30+10+15)
GraphicsWindow.BrushColor = "Red"
Emoji[6] = Shapes.AddText("0")
Shapes.Move(Emoji[6], 160+100, 30+10+15*2)
GraphicsWindow.BrushColor = "Yellow"
Emoji[7] = Shapes.AddText("5")
GraphicsWindow.BrushColor = "MediumBlue"
Shapes.Move(Emoji[7], 160+100, 30+10+15*3)
Emoji[8] = Shapes.AddText("4")
Shapes.Move(Emoji[8], 160+100, 30+10+15*4)
Emoji[9] = Shapes.AddText("7")
Shapes.Move(Emoji[9], 160+100, 30+10+15*5)
Emoji[10] = Shapes.AddText("6")
Shapes.Move(Emoji[10], 160+100, 30+10+15*6)
Emoji[11] = Shapes.AddText("2")
Shapes.Move(Emoji[11], 160+100, 30+10+15*7)
GraphicsWindow.BrushColor = "LightSeaGreen"
Emoji[12] = Shapes.AddText("4")
Shapes.Move(Emoji[12], 160+100, 30+10+15*8)
Emoji[13] = Shapes.AddText("3")
Shapes.Move(Emoji[13], 160+100, 30+10+15*9)
Emoji[14] = Shapes.AddText("8")
Shapes.Move(Emoji[14], 160+100, 30+10+15*10)
GraphicsWindow.BrushColor = "Red"
Emoji[15] = Shapes.AddText("5")
Shapes.Move(Emoji[15], 160+100, 30+10+15*11)
Emoji[16] = Shapes.AddText("0")
Shapes.Move(Emoji[16], 160+100, 30+10+15*12)
Emoji[17] = Shapes.AddText("8")
Shapes.Move(Emoji[17], 160+100, 30+10+15*13)
Emoji[18] = Shapes.AddText("1")
Shapes.Move(Emoji[18], 160+100, 30+10+15*14)
GraphicsWindow.BrushColor = "MediumBlue"
Emoji[19] = Shapes.AddText(" 4 4 80 2 20 1 6")
Shapes.Move(Emoji[19], 160+40, 30+10+15*2)
GraphicsWindow.BrushColor = "Red"
Emoji[20] = Shapes.AddText("56 9")
Shapes.Move(Emoji[20], 160+60, 30+10+15*2)
GraphicsWindow.BrushColor = "LightSeaGreen"
Emoji[21] = Shapes.AddText(" 4 0 2 20 1 41 6 4 77 80")
Shapes.Move(Emoji[21], 160+40, 30+10+15*11)
GraphicsWindow.BrushColor = "DeepPink"
Emoji[22] = Shapes.AddText(" 6 4 7 2 20 1 417 80 4 0")
Shapes.Move(Emoji[22], 160+50, 30+10+15*12)
'絵拡大 ここまで-----------------------------------
Controls.HideControl(pic1)
Controls.ShowControl(pic2)
EndIf
If Controls.LastClickedButton = pic2 Then '探索している部屋 2=右
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "見ていると目が痛くなりそうだ。")
GraphicsWindow.DrawText(8, 308+30, "他を探索しよう。")
Shapes.HideShape(Ewaku)
Shapes.HideShape(Ehaikei)
Shapes.HideShape(Emidorisikaku)
Shapes.HideShape(EPeachPuffmaru)
Shapes.HideShape(ESkyBluemaru)
Shapes.HideShape(Esankaku)
For i = 1 to 22
Shapes.HideShape(Emoji[i])
EndFor
Controls.HideControl(pic2)
Controls.ShowControl(hidaributton)
tansakuheya = 2
EndIf
EndSub

'マウスクリック時のサブルーチン
Sub TMouseDown
mX = GraphicsWindow.MouseX
mY = GraphicsWindow.MouseY
iro = GraphicsWindow.GetPixel(mX, mY)

'ドア調査時セリフ
If Mouse.IsLeftButtonDown and tansakuheya = 1 Then '探索している部屋 1=左
If 250 <= mX And mX <= 330 And 20 <= mY And mY <= 200 Then
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "ドアだ。")
GraphicsWindow.DrawText(8, 308+30, "鍵がかけられていて、ドアノブをいじってみても全く開く様子がない。")
EndIf
EndIf

'タンス調査時セリフ 金庫開けてない
If Mouse.IsLeftButtonDown and tansakuheya = 1 and kinkoopen = 0 Then '探索している部屋 1=左
If iro = "#800000" Or iro = "#A0522D" Then '#800000 Maroon / #A0522D Sienna
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "引き出しがふたつ付いたタンスだ。")
GraphicsWindow.DrawText(8, 308+30, "上の引き出しを開けてみたが空っぽだ。")
GraphicsWindow.DrawText(8, 308+30*2, "下の引き出しはどうだろう?")
Controls.ShowControl(hikidasi1)
Controls.HideControl(migibutton)
tansakuheya = 0 'メッセージ表示中に探索ができないようにする
EndIf
EndIf

'タンス調査時セリフ 金庫開けた
If Mouse.IsLeftButtonDown and tansakuheya = 1 and kinkoopen = 1 Then '探索している部屋 1=左
If iro = "#800000" Or iro = "#A0522D" Then '#800000 Maroon / #A0522D Sienna
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "金庫の中に入っていたメモには、")
GraphicsWindow.DrawText(8, 308+30, "「遥か底の裏に真相がある」と書いてあった。")
GraphicsWindow.DrawText(8, 308+30*2, "もう一度、部屋を調べなおしてみよう。")
EndIf
EndIf

'ゴミ箱調査時セリフ 金庫開けてない
If Mouse.IsLeftButtonDown and tansakuheya = 1 and kinkoopen = 0 Then '探索している部屋 1=左
If iro = "#7FFFD4" Or iro = "#008B8B" Then '#7FFFD4 Aquamarine / #008B8B DarkCyan
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "プラスチック製のゴミ箱だ。")
GraphicsWindow.DrawText(8, 308+30, "中には何も入っていない。")
EndIf
EndIf

'ゴミ箱調査時セリフ 金庫開けた
If Mouse.IsLeftButtonDown and tansakuheya = 1 and kinkoopen = 1 Then '探索している部屋 1=左
If iro = "#7FFFD4" Or iro = "#008B8B" Then '#7FFFD4 Aquamarine / #008B8B DarkCyan
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "プラスチック製のゴミ箱だ。")
GraphicsWindow.DrawText(8, 308+30, "中には何も入っていない。……あっ!")
Controls.ShowControl(gomibako1)
Controls.HideControl(migibutton)
tansakuheya = 0
EndIf
EndIf

'テレビ調査時セリフ
If Mouse.IsLeftButtonDown and tansakuheya = 2 Then '探索している部屋 2=右
If iro = "#696969" Or iro = "#708090" Then '#696969 = DimGray / #708090 = SlateGray
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "大きなテレビが置いてある。")
GraphicsWindow.DrawText(8, 308+30, "電源ボタンを押してみよう。")
Controls.ShowControl(tv1)
Controls.HideControl(hidaributton)
tansakuheya = 0
EndIf
EndIf

'テレビ下紙切れ調査時セリフ
If Mouse.IsLeftButtonDown and tansakuheya = 2 Then '探索している部屋 2=右
If iro = "#DCDCDC" Then '#DCDCDC = Gainsboro
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "台の下に、これ見よがしに何か挟まっている。")
GraphicsWindow.DrawText(8, 308+30, "こんなにわかりやすいヒントを置いておくなんて、")
GraphicsWindow.DrawText(8, 308+30*2, "ここに閉じ込めた奴は何を考えているのやら。")
Controls.ShowControl(kamikire1)
Controls.HideControl(hidaributton)
tansakuheya = 0
EndIf
EndIf

'絵画調査時セリフ
If Mouse.IsLeftButtonDown and tansakuheya = 2 Then '探索している部屋 2=右
If 20 <= mX And mX <= 100 And 20 <= mY And mY <= 80 Then
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "絵が飾ってある。")
GraphicsWindow.DrawText(8, 308+30, "もう少し近づいて見てみよう。")
Controls.ShowControl(pic1)
Controls.HideControl(hidaributton)
tansakuheya = 0
EndIf
EndIf

'窓調査時セリフ
If Mouse.IsLeftButtonDown and tansakuheya = 2 Then '探索している部屋 2=右
If iro = "#F5F5DC" Or iro = "#D2B48C" Then '#F5F5DC Beige / #D2B48C Tan
GraphicsWindow.BrushColor = bgcolor
GraphicsWindow.FillRectangle(7, 307, 425, 150)
GraphicsWindow.BrushColor = mojicolor
GraphicsWindow.DrawText(8, 308, "小さい窓だ。曇りガラスで外は見えない。")
GraphicsWindow.DrawText(8, 308+30, "もしこのガラスを破れたとしても、")
GraphicsWindow.DrawText(8, 308+30*2, "ここを通って外に脱出することは無理だ。")
EndIf
EndIf

EndSub