1: 2: logic 3: { 4: array map 5: { 6: 1, 1, 1, 1, 1, 1, 1, 1, 1, 7: 1, 0, 0, 0, 0, 0, 2, 0, 1, 8: 1, 0, 0, 0, 0, 0, 0, 0, 1, 9: 1, 0, 0, 0, 0, 1, 0, 0, 1, 10: 1, 0, 0, 0, 0, 1, 0, 0, 1, 11: 1, 0, 0, 1, 1, 1, 1, 1, 1, 12: 1, 0, 0, 0, 0, 0, 0, 0, 1, 13: 1, 0, 0, 0, 0, 0, 0, 0, 1, 14: 1, 1, 1, 1, 1, 1, 1, 1, 1 15: } 16: int mapwidth { 9 } 17: int mapheight { 9 } 18: 19: // 0 = floor 20: // 1 = wall 21: // 2 = player 22: 23: // This should be taken from the map rather than set up manually, but I don't want to do an init step at the moment. 24: int location { 15 } 25: 26: when 27: { 28: (map[location-1] == 0) 29: } 30: allow 31: { 32: map[location-1] = map[location]; 33: map[location] = 0; 34: location = location - 1; 35: } 36: label { "key_a" } 37: 38: when 39: { 40: (map[location+1] == 0) 41: } 42: allow 43: { 44: map[location+1] = map[location]; 45: map[location] = 0; 46: location = location + 1; 47: } 48: label { "key_d" } 49: 50: when 51: { 52: (map[location+mapwidth] == 0) 53: } 54: allow 55: { 56: map[location+mapwidth] = map[location]; 57: map[location] = 0; 58: location = location + mapwidth; 59: } 60: label { "key_s" } 61: 62: when 63: { 64: (map[location-mapwidth] == 0) 65: } 66: allow 67: { 68: map[location-mapwidth] = map[location]; 69: map[location] = 0; 70: location = location - mapwidth; 71: } 72: label { "key_w" } 73: } 74: 75: display 76: { 77: stringtable counters 78: { 79: ".", 80: "#", 81: "@" 82: } 83: 84: box 85: { 86: content { "Psuedo-Doom" } 87: } 88: 89: newline 90: 91: for y ( 0 .. (mapheight-1) ) 92: { 93: for x ( 0 .. (mapwidth-1) ) 94: { 95: box 96: { 97: width { 1.1em } 98: height { 1em } 99: content { counters[ map[(y*mapwidth)+x] ] } 100: } 101: } 102: newline 103: } 104: 105: newline 106: 107: // Controls 108: box 109: { 110: width { 2em } 111: height { 1em } 112: border { 1px solid black } 113: content { "q" } 114: bind_action { "key_q" } 115: } 116: box 117: { 118: width { 2em } 119: height { 1em } 120: border { 1px solid black } 121: content { "w" } 122: bind_action { "key_w" } 123: } 124: box 125: { 126: width { 2em } 127: height { 1em } 128: border { 1px solid black } 129: content { "e" } 130: bind_action { "key_e" } 131: } 132: 133: newline 134: 135: box 136: { 137: width { 0.6em } 138: height { 1em } 139: } 140: box 141: { 142: width { 2em } 143: height { 1em } 144: border { 1px solid black } 145: content { "a" } 146: bind_action { "key_a" } 147: } 148: box 149: { 150: width { 2em } 151: height { 1em } 152: border { 1px solid black } 153: 154: content { "s" } 155: bind_action { "key_s" } 156: } 157: box 158: { 159: width { 2em } 160: height { 1em } 161: border { 1px solid black } 162: content { "d" } 163: bind_action { "key_d" } 164: } 165: 166: newline 167: 168: box 169: { 170: content{ "WASD... Now all we need is 3D and we'll have Quake in no time..." } 171: } 172: } 173: