1 ! The Mad Bomber - a Z-Machine version of the classic Bomber game
3 ! by Neil James Brown. Release 3 / 971123. This game is Public Domain.
5 ! Needs an interpreter that supports timed input. Colour recommended!
11 Array buildings -> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
13 Array hi_scorer -> "The Mad Bomber ";
15 Global skill_level = 0;
20 Global use_colour = 1;
27 [ Bomber i j option temp1;
29 if (i&1==0) use_colour=0; ! can't use colour - darn it!
32 if (height>18) height=18;
33 if (i&128==0 || height<15 || width<60)
34 { print "~The Mad Bomber~ has detected one or more problems with your
36 if (height<15) print "- The screen height is less than 15 characters
38 if (width<60) print "- The screen width is less than 60 characters
40 if (i&128==0) print "- This interpreter cannot handle timed events.^";
41 print "^Unfortunately, this means that the game is unable to run. Please
42 reconfigure your interpreter, or change for one that fully supports the
43 Z-machine.^^[Please press any key to exit.]^^";
50 print "^^^^THE MAD BOMBER^";
52 print "(3.971123 / Inform 6.13)^^";
53 print "by NJB 1997^^^High score is ", hi_score, " by ";
54 for (temp1=0: temp1<23: temp1++)
55 { print (char) hi_scorer->temp1;
58 print "^^^Press <SPACE> to play, I for information or Q to quit.^";
60 { @read_char 1 0 0 option;
61 } until (option==32 or 73 or 105 or 81 or 113);
66 } until (dead_flag==1);
69 for (temp1=0: temp1<=22: temp1++)
70 { hi_scorer->temp1=32;
76 print "Enter your name:";
80 { @read_char 1 0 0 option;
81 if (option>31 && option<127)
83 { hi_scorer->temp1=option;
91 { @set_cursor 4 temp1;
104 if (option==73 or 105)
105 { @erase_window $ffff;
106 print "^^^^It is examination day at ~The Mad Bomber School of Flying~,
107 but a miscalculation has resulted in the planes not having enough
108 fuel to return to their airstrip. Fortunately, all Mad Bomber planes
109 have an infinite supply of bombs on board. An idea is hatched - the
110 trainee pilots must completely level the cities they are over in order
111 to land safely. The authorities may not be too impressed with this
112 strategy, but we'll worry about that later!^^<SPACE> drops a bomb
113 (you can only drop one bomb at a time).^^<P> pauses the game, with any
114 key resuming.^^<Q> quits the current game.^^^[Press any key to
116 @read_char 1 0 0 temp1;
119 } until (option==81 or 113);
121 print "^^^^^^^Thanks for playing!^";
125 [ BomberGame i j x y bx by temp1 temp2 temp3 pausetime;
127 if (skill_level<5) pausetime=3;
129 { if (skill_level<10) pausetime=2;
136 @split_window height;
138 if (use_colour==1) @set_colour 1 2;
144 for (i=1: i<=15: i++)
152 for (j=2: j<=14: j++)
161 { switch(skill_level)
165 default: by=random(3)+7;
174 for (j=(15-by): j<15: j++)
177 if (use_colour==1) print " ";
196 { @set_cursor 1 width;
197 @read_char 1 1 TimeOut i;
198 if (i==80 or 112) BomberPause();
199 if (i==81 or 113) dead_flag=1;
206 temp2=(15-(buildings->temp1));
208 { if (buildings->temp1>0)
212 if (buildings->temp1>3)
213 { for (temp3=temp2: temp3<(temp2+3): temp3++)
214 { @set_cursor temp3 bx;
218 buildings->temp1=(buildings->temp1)-3;
221 { for (temp3=temp2: temp3<=14: temp3++)
222 { @set_cursor temp3 bx;
231 if (by>15) { bx=0; by=0; }
252 if (y<14) { x=2; y++; }
257 temp2=(15-(buildings->temp1));
261 for (i=0: i<=10: i++)
262 { @read_char 1 1 TimeOut j;
272 until (win_flag==1 || dead_flag==1);