×

[PR]この広告は3ヶ月以上更新がないため表示されています。
ホームページを更新後24時間以内に表示されなくなります。

ゲームを作ろう! 地下迷宮その2 迷宮を作ろう


その1 背景を作ろうの続きです。

肝心の、迷宮を移動する為のプログラムも考えましょう。
これは今までの、「テキストアドベンチャーゲームを作ろう!」あたりの考え方を応用すればなんとかなるはずです。

まず、ボタンを用意しておきます。
「前に進む」
「左に進む」
「右に進む」
という3つのボタンを設置すると前回書きましたが、厳密には、
「(1Nに居る時)前に進む」
「(1Nに居る時)左に進む」
「(1Nに居る時)右に進む」
「(1Sに居る時)前に進む」
「(1Sに居る時)左に進む」
「(1Sに居る時)右に進む」
……
というボタン、合計11×3=33個を用意しておく必要があります。

更に、各マップへの移動用ボタン「|>」も設置します。
これは実際には

「|>(1Sへ)」
「|>(1Eへ)」
……

という意味で、これを押したら、移動先の

「(1Sに居る時)前に進む」
「(1Sに居る時)左に進む」
「(1Sに居る時)右に進む」

を表示する、という感じです。

プログラム開始時には

「(1Nに居る時)前に進む」
「(1Nに居る時)左に進む」
「(1Nに居る時)右に進む」

の3つのボタンのみ表示し、他はControls.HideControl(controlName)でボタンを一時的に非表示にします。
後は、

If 「(1Nに居る時)前に進む」を押した Then
  背景を非表示(黒くする)
  「(1Nに居る時)前に進む」
  「(1Nに居る時)左に進む」
  「(1Nに居る時)右に進む」
  の3つのボタンを非表示
  「|>(4Nへ)」
  のボタンを表示
  メッセージウィンドウに「前に進んだ。」と表示
EndIf

………………

If 「|>(4Nへ)」を押した Then
  4N背景を表示
  「|>(4Nへ)」
  のボタンを非表示
  「(4Nに居る時)前に進む」
  「(4Nに居る時)左に進む」
  「(4Nに居る時)右に進む」
  の3つのボタンを表示
  メッセージウィンドウに「どうする?」と表示
  EndIf

……これをひたすら記述していく、という訳です。
地道な上、ミスが怖いので慎重にメモしながら書いていきましょう。

完成した地下迷宮のプログラムは以下の通り。相変わらず長いです。

GraphicsWindow.Title = "meiro"
GraphicsWindow.Width = 640
GraphicsWindow.Height = 480

color1 = "White"
color2 = "LightGray"
color3 = "DarkGray"
color4 = "DimGray"
color5 = "Black"

GraphicsWindow.FontName = "Meiryo UI"

GraphicsWindow.BackgroundColor = color5

GraphicsWindow.BrushColor = color1
GraphicsWindow.PenColor = color1
GraphicsWindow.FontSize = 18
GraphicsWindow.DrawRectangle(10, 310, 620, 160)
GraphicsWindow.DrawText(20, 320, "ここは、地下迷宮。")

GraphicsWindow.BrushColor = color5

'ボタン設置
map1Nmae = Controls.AddButton("前に進む", 280, 400)
map1Nmigi = Controls.AddButton("右に進む", 480, 400)
map1Nhidari = Controls.AddButton("左に進む", 80, 400)

map1Smae = Controls.AddButton("前に進む", 280, 400)
map1Smigi = Controls.AddButton("右に進む", 480, 400)
map1Shidari = Controls.AddButton("左に進む", 80, 400)

map1Emae = Controls.AddButton("前に進む", 280, 400)
map1Emigi = Controls.AddButton("右に進む", 480, 400)
map1Ehidari = Controls.AddButton("左に進む", 80, 400)

map2Smae = Controls.AddButton("前に進む", 280, 400)
map2Smigi = Controls.AddButton("右に進む", 480, 400)
map2Shidari = Controls.AddButton("左に進む", 80, 400)

map2Emae = Controls.AddButton("前に進む", 280, 400)
map2Emigi = Controls.AddButton("右に進む", 480, 400)
map2Ehidari = Controls.AddButton("左に進む", 80, 400)

map2Wmae = Controls.AddButton("前に進む", 280, 400)
map2Wmigi = Controls.AddButton("右に進む", 480, 400)
map2Whidari = Controls.AddButton("左に進む", 80, 400)

map3Wmae = Controls.AddButton("前に進む", 280, 400)
map3Wmigi = Controls.AddButton("右に進む", 480, 400)
map3Whidari = Controls.AddButton("左に進む", 80, 400)

map4Nmae = Controls.AddButton("前に進む", 280, 400)
map4Nmigi = Controls.AddButton("右に進む", 480, 400)
map4Nhidari = Controls.AddButton("左に進む", 80, 400)

map4Emae = Controls.AddButton("前に進む", 280, 400)
map4Emigi = Controls.AddButton("右に進む", 480, 400)
map4Ehidari = Controls.AddButton("左に進む", 80, 400)

map5Nmae = Controls.AddButton("前に進む", 280, 400)
map5Nmigi = Controls.AddButton("右に進む", 480, 400)
map5Nhidari = Controls.AddButton("左に進む", 80, 400)

map5Wmae = Controls.AddButton("前に進む", 280, 400)
map5Wmigi = Controls.AddButton("右に進む", 480, 400)
map5Whidari = Controls.AddButton("左に進む", 80, 400)

go1N = Controls.AddButton("|>(1Nへ)", 480, 400)
go1S = Controls.AddButton("|>(1Sへ)", 480, 400)
go1E = Controls.AddButton("|>(1Eへ)", 480, 400)
go2S = Controls.AddButton("|>(2Sへ)", 480, 400)
go2E = Controls.AddButton("|>(2Eへ)", 480, 400)
go2W = Controls.AddButton("|>(2Wへ)", 480, 400)
go3W = Controls.AddButton("|>(3Wへ)", 480, 400)
go4N = Controls.AddButton("|>(4Nへ)", 480, 400)
go4E = Controls.AddButton("|>(4Eへ)", 480, 400)
go5N = Controls.AddButton("|>(5Nへ)", 480, 400)
go5W = Controls.AddButton("|>(5Wへ)", 480, 400)

'一度ボタン隠し
Controls.HideControl(map1Smae)
Controls.HideControl(map1Smigi)
Controls.HideControl(map1Shidari)
Controls.HideControl(map1Emae)
Controls.HideControl(map1Emigi)
Controls.HideControl(map1Ehidari)
Controls.HideControl(map2Smae)
Controls.HideControl(map2Smigi)
Controls.HideControl(map2Shidari)
Controls.HideControl(map2Emae)
Controls.HideControl(map2Emigi)
Controls.HideControl(map2Ehidari)
Controls.HideControl(map2Wmae)
Controls.HideControl(map2Wmigi)
Controls.HideControl(map2Whidari)
Controls.HideControl(map3Wmae)
Controls.HideControl(map3Wmigi)
Controls.HideControl(map3Whidari)
Controls.HideControl(map4Nmae)
Controls.HideControl(map4Nmigi)
Controls.HideControl(map4Nhidari)
Controls.HideControl(map4Emae)
Controls.HideControl(map4Emigi)
Controls.HideControl(map4Ehidari)
Controls.HideControl(map5Nmae)
Controls.HideControl(map5Nmigi)
Controls.HideControl(map5Nhidari)
Controls.HideControl(map5Wmae)
Controls.HideControl(map5Wmigi)
Controls.HideControl(map5Whidari)
Controls.HideControl(go1N)
Controls.HideControl(go1S)
Controls.HideControl(go1E)
Controls.HideControl(go2S)
Controls.HideControl(go2E)
Controls.HideControl(go2W)
Controls.HideControl(go3W)
Controls.HideControl(go4N)
Controls.HideControl(go4E)
Controls.HideControl(go5N)
Controls.HideControl(go5W)

'map1N(初期)背景------------------
'haikei 1
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)

'haikei 2
GraphicsWindow.BrushColor = color1
GraphicsWindow.FillRectangle(120, 60, 80, 60)

'haikei 3
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillTriangle(200, 60, 200, 120, 280, 120)

'haikei 4
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)

'haikei 5
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillRectangle(280, 0, 80, 120)

'haikei 6
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)

'haikei 7
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)

'haikei 8
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillRectangle(440, 60, 80, 60)

'haikei 9
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillTriangle(360, 120, 440, 60, 440, 120)

'haikei 10
GraphicsWindow.BrushColor = color1
GraphicsWindow.FillRectangle(120, 120, 80, 60)

'haikei 11
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillRectangle(200, 120, 80, 60)

'haikei 12
GraphicsWindow.BrushColor = color5
GraphicsWindow.FillRectangle(280, 120, 80, 60)

'haikei 13
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillRectangle(360, 120, 80, 60)

'haikei 14
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillRectangle(440, 120, 80, 60)

'haikei 15
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)

'haikei 16
GraphicsWindow.BrushColor = color1
GraphicsWindow.FillRectangle(120, 180, 80, 60)

'haikei 17
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillTriangle(200, 180, 200, 240, 280, 180)

'haikei 18
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)

'haikei 19
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillRectangle(280, 180, 80, 120)

'haikei 20
GraphicsWindow.BrushColor = color2
GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)

'haikei 21
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)

'haikei 22
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillRectangle(440, 180, 80, 60)

'haikei 23
GraphicsWindow.BrushColor = color4
GraphicsWindow.FillTriangle(360, 180, 440, 180, 440, 240)
'map1N(初期)背景------------------ここまで

Controls.ButtonClicked = OnButtonClick

Sub OnButtonClick
  If Controls.LastClickedButton = map1Nmae Then
    '1N → 前4N
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前に進んだ。")
    Controls.HideControl(map1Nmae)
    Controls.HideControl(map1Nmigi)
    Controls.HideControl(map1Nhidari)
    Controls.ShowControl(go4N)
  EndIf
  If Controls.LastClickedButton = map1Nhidari Then
    '1N → 左2W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左に進んだ。")
    Controls.HideControl(map1Nmae)
    Controls.HideControl(map1Nmigi)
    Controls.HideControl(map1Nhidari)
    Controls.ShowControl(go2W)
  EndIf
  If Controls.LastClickedButton = map1Nmigi Then
    '1N → 右 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map1Smigi Then
    '1S → 右2W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右に進んだ。")
    Controls.HideControl(map1Smae)
    Controls.HideControl(map1Smigi)
    Controls.HideControl(map1Shidari)
    Controls.ShowControl(go2W)
  EndIf
  If Controls.LastClickedButton = map1Smae Then
    '1S → 前に入口
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "入口の扉だ。戻る必要はない。他の方向に進もう。")
  EndIf
  If Controls.LastClickedButton = map1Shidari Then
    '1S → 左 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map1Ehidari Then
    '1E → 左4N
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左に進んだ。")
    Controls.HideControl(map1Emae)
    Controls.HideControl(map1Emigi)
    Controls.HideControl(map1Ehidari)
    Controls.ShowControl(go4N)
  EndIf
  If Controls.LastClickedButton = map1Emigi Then
    '1E → 右に入口
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "入口の扉だ。戻る必要はない。他の方向に進もう。")
  EndIf
  If Controls.LastClickedButton = map1Emae Then
    '1E → 前 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map2Shidari Then
    '2S → 左1E
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左に進んだ。")
    Controls.HideControl(map2Smae)
    Controls.HideControl(map2Smigi)
    Controls.HideControl(map2Shidari)
    Controls.ShowControl(go1E)
  EndIf
  If Controls.LastClickedButton = map2Smigi Then
    '2S → 右3W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右に進んだ。")
    Controls.HideControl(map2Smae)
    Controls.HideControl(map2Smigi)
    Controls.HideControl(map2Shidari)
    Controls.ShowControl(go3W)
  EndIf
  If Controls.LastClickedButton = map2Smae Then
    '2S → 前 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map2Ehidari Then
    '2E → 左5N
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左に進んだ。")
    Controls.HideControl(map2Emae)
    Controls.HideControl(map2Emigi)
    Controls.HideControl(map2Ehidari)
    Controls.ShowControl(go5N)
  EndIf
  If Controls.LastClickedButton = map2Emae Then
    '2E → 前1E
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前に進んだ。")
    Controls.HideControl(map2Emae)
    Controls.HideControl(map2Emigi)
    Controls.HideControl(map2Ehidari)
    Controls.ShowControl(go1E)
  EndIf
  If Controls.LastClickedButton = map2Emigi Then
    '2E → 右 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map2Wmigi Then
    '2W → 右5N
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右に進んだ。")
    Controls.HideControl(map2Wmae)
    Controls.HideControl(map2Wmigi)
    Controls.HideControl(map2Whidari)
    Controls.ShowControl(go5N)
  EndIf
  If Controls.LastClickedButton = map2Wmae Then
    '2W → 前3W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前に進んだ。")
    Controls.HideControl(map2Wmae)
    Controls.HideControl(map2Wmigi)
    Controls.HideControl(map2Whidari)
    Controls.ShowControl(go3W)
  EndIf
  If Controls.LastClickedButton = map3Wmae Then
    '3W → 行き止まりのため強制でもどる 2E
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "元の場所に戻った。")
    Controls.HideControl(map3Wmae)
    Controls.HideControl(map3Wmigi)
    Controls.HideControl(map3Whidari)
    Controls.ShowControl(go2E)
  EndIf
  If Controls.LastClickedButton = map4Nhidari Then
    '4N → 左5W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左に進んだ。")
    Controls.HideControl(map4Nmae)
    Controls.HideControl(map4Nmigi)
    Controls.HideControl(map4Nhidari)
    Controls.ShowControl(go5W)
  EndIf
  If Controls.LastClickedButton = map4Nmigi Then
    '4N → 右 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map4Nmae Then
    '4N → 前 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map4Emigi Then
    '4E → 右1S
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右に進んだ。")
    Controls.HideControl(map4Emae)
    Controls.HideControl(map4Emigi)
    Controls.HideControl(map4Ehidari)
    Controls.ShowControl(go1S)
  EndIf
  If Controls.LastClickedButton = map4Ehidari Then
    '4E → 左 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map4Emae Then
    '4E → 前 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map5Nmae Then
    '5N → 正面に出口
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "出口の扉だ!(終わり)")
    Controls.HideControl(map5Nmae)
    Controls.HideControl(map5Nmigi)
    Controls.HideControl(map5Nhidari)
  EndIf
  If Controls.LastClickedButton = map5Nmigi Then
    '5N → 右4E
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "右に進んだ。")
    Controls.HideControl(map5Nmae)
    Controls.HideControl(map5Nmigi)
    Controls.HideControl(map5Nhidari)
    Controls.ShowControl(go4E)
  EndIf
  If Controls.LastClickedButton = map5Nhidari Then
    '5N → 左 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左は壁だ。他の方向を選ぼう。")
  EndIf
  If Controls.LastClickedButton = map5Wmigi Then
    '5W → 右に出口
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "出口の扉だ!(終わり)")
    Controls.HideControl(map5Wmae)
    Controls.HideControl(map5Wmigi)
    Controls.HideControl(map5Whidari)
  EndIf
  If Controls.LastClickedButton = map5Whidari Then
    '5W → 左2S
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.FillRectangle(120, 0, 400, 300) '背景消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "左に進んだ。")
    Controls.HideControl(map5Wmae)
    Controls.HideControl(map5Wmigi)
    Controls.HideControl(map5Whidari)
    Controls.ShowControl(go2S)
  EndIf
  If Controls.LastClickedButton = map5Wmae Then
    '5W → 前 壁
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "前は壁だ。他の方向を選ぼう。")
  EndIf

  If Controls.LastClickedButton = go1S Then
    '1S
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '1Sマップ上書き
    '右に通路---------------------------------
    'haikei 1
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)

    'haikei 2
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 60, 80, 60)

    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)

    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)

    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)

    'haikei 7
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)

    'haikei 8
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 60, 80, 60)

    'haikei 10
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 120, 80, 60)

    'haikei 14
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)

    'haikei 16
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 180, 80, 60)

    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)

    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)

    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)

    'haikei 21
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)

    'haikei 22
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 180, 80, 60)

    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)

    'door chuou
    GraphicsWindow.BrushColor = "SaddleBrown"
    GraphicsWindow.FillRectangle(280, 60, 80, 180)
    GraphicsWindow.BrushColor = "NavajoWhite"
    GraphicsWindow.FillEllipse(345, 150, 10, 10)

    '右に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go1S)
    Controls.ShowControl(map1Smae)
    Controls.ShowControl(map1Smigi)
    Controls.ShowControl(map1Shidari)
  EndIf
  If Controls.LastClickedButton = go1E Then
    '1E
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '1Eマップ上書き
    '左に通路---------------------------------
    
    'haikei 1
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 10
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)
    
    'door migi
    GraphicsWindow.BrushColor = "SaddleBrown"
    GraphicsWindow.FillRectangle(440+25, 40, 25, 180+40)
    GraphicsWindow.FillTriangle(440+25, 40, 440+50, 20, 440+50, 40)
    GraphicsWindow.FillTriangle(440+25, 240+20, 440+50, 240+20, 440+50, 240+40)
    GraphicsWindow.BrushColor = "NavajoWhite"
    GraphicsWindow.FillEllipse(440+45, 150, 3, 10)
    
    '左に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go1E)
    Controls.ShowControl(map1Emae)
    Controls.ShowControl(map1Emigi)
    Controls.ShowControl(map1Ehidari)
  EndIf
  If Controls.LastClickedButton = go2S Then
    '2S
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '2Sマップ上書き
    '右と左に通路---------------------------------
    
    'haikei 1
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 10
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)
    
    '右と左に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go2S)
    Controls.ShowControl(map2Smae)
    Controls.ShowControl(map2Smigi)
    Controls.ShowControl(map2Shidari)
  EndIf
  If Controls.LastClickedButton = go2E Then
    '2E
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '2Eマップ上書き
    '左と正面に通路---------------------------------

    
    'haikei 1
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 3
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(200, 60, 200, 120, 280, 120)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 9
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(360, 120, 440, 60, 440, 120)
    
    'haikei 10
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 11
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(200, 120, 80, 60)
    
    'haikei 12
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(280, 120, 80, 60)
    
    'haikei 13
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(360, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 17
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(200, 180, 200, 240, 280, 180)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 23
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(360, 180, 440, 180, 440, 240)
    
    '左と正面に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go2E)
    Controls.ShowControl(map2Emae)
    Controls.ShowControl(map2Emigi)
    Controls.ShowControl(map2Ehidari)
  EndIf
  If Controls.LastClickedButton = go2W Then
    '2W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '2Wマップ上書き
    '右と正面に通路---------------------------------

    
    'haikei 1
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 3
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(200, 60, 200, 120, 280, 120)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 9
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(360, 120, 440, 60, 440, 120)
    
    'haikei 10
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 11
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(200, 120, 80, 60)
    
    'haikei 12
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(280, 120, 80, 60)
    
    'haikei 13
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(360, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 17
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(200, 180, 200, 240, 280, 180)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 23
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(360, 180, 440, 180, 440, 240)
    
    '右と正面に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go2W)
    Controls.ShowControl(map2Wmae)
    Controls.ShowControl(map2Wmigi)
    Controls.ShowControl(map2Whidari)
  EndIf
  If Controls.LastClickedButton = go3W Then
    '3W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '3Wマップ上書き
    '行き止まり---------------------------------

    
    'haikei 1
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 10
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)
    
    '行き止まり---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "ここは行き止まりだ。前に戻ろう。")
    Controls.HideControl(go3W)
    Controls.ShowControl(go2E)
  EndIf
  If Controls.LastClickedButton = go4N Then
    '4N
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '4Nマップ上書き
    '左に通路---------------------------------
    
    'haikei 1
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 10
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)

    '左に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go4N)
    Controls.ShowControl(map4Nmae)
    Controls.ShowControl(map4Nmigi)
    Controls.ShowControl(map4Nhidari)
  EndIf
  If Controls.LastClickedButton = go4E Then
    '4E
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '4Eマップ上書き
    '右に通路---------------------------------
    
    'haikei 1
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 10
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)
    
    '右に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go4E)
    Controls.ShowControl(map4Emae)
    Controls.ShowControl(map4Emigi)
    Controls.ShowControl(map4Ehidari)
  EndIf
  If Controls.LastClickedButton = go5N Then
    '5N
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '5Nマップ上書き
    '右に通路---------------------------------
    
    'haikei 1
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 10
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)
    
    'goal door chuou
    GraphicsWindow.BrushColor = "SteelBlue"
    GraphicsWindow.FillRectangle(280, 60, 80, 180)
    GraphicsWindow.BrushColor = "PowderBlue"
    GraphicsWindow.FillEllipse(345, 150, 10, 10)
    
    '右に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go5N)
    Controls.ShowControl(map5Nmae)
    Controls.ShowControl(map5Nmigi)
    Controls.ShowControl(map5Nhidari)
  EndIf
  If Controls.LastClickedButton = go5W Then
    '5W
    GraphicsWindow.BrushColor = color5
    GraphicsWindow.FillRectangle(12, 312, 610, 150) 'メッセージウィンドウ消し
    '5Wマップ上書き
    '左に通路---------------------------------
    
    'haikei 1
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 120, 60, 200, 60)
    
    'haikei 2
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 60, 80, 60)
    
    'haikei 4
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 0, 280, 0, 280, 120)
    
    'haikei 5
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 0, 80, 120)
    
    'haikei 6
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 0, 360, 120, 520, 0)
    
    'haikei 7
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(520, 0, 440, 60, 520, 60)
    
    'haikei 8
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 60, 80, 60)
    
    'haikei 10
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 120, 80, 60)
    
    'haikei 14
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 120, 80, 60)
    
    'haikei 15
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 240, 200, 240, 120, 300)
    
    'haikei 16
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(120, 180, 80, 60)
    
    'haikei 18
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(120, 300, 280, 180, 280, 300)
    
    'haikei 19
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillRectangle(280, 180, 80, 120)
    
    'haikei 20
    GraphicsWindow.BrushColor = color2
    GraphicsWindow.FillTriangle(360, 180, 360, 300, 520, 300)
    
    'haikei 21
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillTriangle(440, 240, 520, 240, 520, 300)
    
    'haikei 22
    GraphicsWindow.BrushColor = color4
    GraphicsWindow.FillRectangle(440, 180, 80, 60)
    
    'haikei 24
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.FillRectangle(200, 60, 240, 180)
    
    'goal door migi
    GraphicsWindow.BrushColor = "SteelBlue"
    GraphicsWindow.FillRectangle(440+25, 40, 25, 180+40)
    GraphicsWindow.FillTriangle(440+25, 40, 440+50, 20, 440+50, 40)
    GraphicsWindow.FillTriangle(440+25, 240+20, 440+50, 240+20, 440+50, 240+40)
    GraphicsWindow.BrushColor = "PowderBlue"
    GraphicsWindow.FillEllipse(440+45, 150, 3, 10)
    
    '左に通路---------------------------------ここまで
    GraphicsWindow.BrushColor = color1
    GraphicsWindow.DrawText(20, 320, "どうする?")
    Controls.HideControl(go5W)
    Controls.ShowControl(map5Wmae)
    Controls.ShowControl(map5Wmigi)
    Controls.ShowControl(map5Whidari)
  EndIf
EndSub


迷宮

迷宮

迷宮

なお、このプログラムは行き先チェック用(要するにデバッグ用)に、移動用ボタンが「|>(1Nへ)」などの表示のままです。
実際に誰かにプレイしてもらう時には、

GraphicsWindow.FontName = "Wingdings 3"
go1N = Controls.AddButton("u", 480, 400)
go1S = Controls.AddButton("u", 480, 400)
go1E = Controls.AddButton("u", 480, 400)
go2S = Controls.AddButton("u", 480, 400)
go2E = Controls.AddButton("u", 480, 400)
go2W = Controls.AddButton("u", 480, 400)
go3W = Controls.AddButton("u", 480, 400)
go4N = Controls.AddButton("u", 480, 400)
go4E = Controls.AddButton("u", 480, 400)
go5N = Controls.AddButton("u", 480, 400)
go5W = Controls.AddButton("u", 480, 400)
GraphicsWindow.FontName = "Meiryo UI"

このようにして、右矢印のみを表示するようにしないと、プレイヤーに居場所がバレバレになってしまいますから注意。
自分でプレイして、問題がないようだったらボタン表示を直しましょう。

ということで、画像ファイルを使わなくても、疑似3D地下迷宮みたいなゲームが作れますよ、という話でした。
もちろん、これに更にマップを付け加えたり、壁に文字でも書いてみたり、行き止まりに宝箱を置いたりしてみれば、更に面白い地下迷宮が作れるはずです。



▲TOPへ戻る