A Strange Journey
Summary
|
Download | Design Goals
|
Tool: Room/Map Builder
In addition to the main program itself I created a program to build out the world. This tool’s output mirrored my main programs file reading syntax (input) and allowed me to create large play spaces quickly. Once created it was a simple matter of editing the file created to add additional content.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Mapmaker_for_txt_adventure { class Program { static void Main(string[] args) { /*string[] test = { "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}; //room descriptions List maplist = new List(); for (int x = 0; x < test.Length; x++) { for (int y = 0; y < test[x].Length; y++) { if (test[x][y] == ' ') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Short Description Goes here."); maplist.Add("Long: Long Description goes here."); maplist.Add(""); } if (test[x][y] == 'Y') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Your Car"); maplist.Add("Long: Player Start."); maplist.Add(""); } if (test[x][y] == 'T') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Forest"); maplist.Add("Long: Forest Area."); maplist.Add(""); } if (test[x][y] == 'B') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Forest objective room"); maplist.Add("Long: Forest Area."); maplist.Add(""); } if (test[x][y] == 'O') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Tower"); maplist.Add("Long: Tower Area."); maplist.Add(""); } /*if (test[x][y] == 'R') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Ruined Building"); maplist.Add("Long: Ruined Building."); maplist.Add(""); } if (test[x][y] == 'P') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Winding Path"); maplist.Add("Long: A Winding path."); maplist.Add(""); }*/ if (test[x][y] == 'I') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Winding Path Objective Room"); maplist.Add("Long: A Winding path."); maplist.Add(""); } if (test[x][y] == 'C') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Dark Cave"); maplist.Add("Long: A Dark Cave, Spooky."); maplist.Add(""); } if (test[x][y] == 'D') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Dark Cave objective room"); maplist.Add("Long: A Dark Cave, Spooky."); maplist.Add(""); } if (test[x][y] == 'S') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Sidewalk"); maplist.Add("Long: A cracked and slightly damp sidewalk."); maplist.Add(""); } if (test[x][y] == 'R') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Road"); maplist.Add("Long: An empty stretch of road. Keep an eye out for cars."); maplist.Add(""); } if (test[x][y] == 'P') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: Portal"); maplist.Add("Long: As you step into this slice of nowhere a brilliant blue portal| opens up. Your blinded by the light and when your|vision clears you are somewhere else. "); maplist.Add(""); } if (test[x][y] == 'G') { maplist.Add("Room"); maplist.Add("Loc:" + x + "," + y); maplist.Add("Short: A patch of grass"); maplist.Add("Long: A patch of grass surrounded by dense forest."); maplist.Add(""); } } } //file writing StreamWriter writer = null; try { writer = new StreamWriter("rooms.txt"); } catch (Exception e) { Console.WriteLine("ERROR: File '" + "rooms.txt" + "' could not be written."); Console.WriteLine("Problem: " + e.Message); } //write maplist to file for (int x=0;x<maplist.Count();x++) { writer.WriteLine("{0}",maplist[x]); } writer.Close(); } } } |