Pages

Sunday, 26 March 2017

Combat Arien

Here's another 10-Liner Basic Programming Contest entry for 2017. Info about the contest can be found here: http://gkanold.wixsite.com/homeputerium/basic-10liners-2017. In addition to my entry of a 10-liner version of Mine Sweeper and the Monteiro Challenge, I have completed a simple flight combat simulator called "Combat Arien."


There were lots of other entries along similar lines in the contest. It's unlikely mine will impress, given the greater power and graphics of 8-bit systems like the Atari and others.
Interceptor

Space Ranger

A contest like this, which involves a bunch of classic 8-bit home computers spanning the entire 1980s reminds me that my beloved MC-10 was based on the TRS-80 Color Computer (Coco), which was a system built on hardware from before the late 70s. In particular its graphic chip, the Motorola MC6847, was a particularly early graphic chip for home computers. Don't get me wrong, I love this neon green wonder. I also appreciate how well Tandy worked at maintaining compatibility across its whole Coco line right into the 1990s. The Coco 1 (1980) was a contemporary of the VIC20. The Coco 2 (1982) was a contemporary of the Commodore 64. The Coco 3 (1985) was a contemporary of the Atari ST. Yet each of these machines was able to run the software from the earlier machines. The VIC20, for example, wasn't around in 1985 running a multi-user, multitasking operating system. But a Coco 1 (upgraded to 64K) could. And the MC-10 was a part of this venerable family.

The program was based on some code from a type-in book for the Matra Hachette Alice. I was browsing through it and saw that it was a flight combat game. I had seen the other games for the contest and I had been wanting to make an updated flight shoot-em-up game for some time. But I was really disappointed when I saw what the game code produced.

The program has the idea of the four white blocks to make a cross hair, but other than that the plane is just two blocks connected by a dash.  And the sky is orange! The plane leaves behind a trail of cyan coloured blocks as it jigs around the orange sky. One shot on the plane brings victory and the end of the game, but the plane moved in increments of two, which makes its flight extremely jerky and erratic. I kept the basic gun shots converging on the target idea and the 4 block cross hair, but replaced just about everything else. The book "102 Programmes Pour Alice et TRS MC/10," which can be found here: http://alice32.free.fr/documentation/102-programmes/102-programmes.djvu
See page 166 for the original.  Here's my code in short and long form:

0 CLS6:A=5:B=14:HT=0:TI=0:SH=0:N=15:POKE17026,6
1 PRINT@32*A+B,"ÞØÜ";:TI=TI+1:U=A:V=B:A=A+2-RND(3):B=B+2-RND(3):K=PEEK(2)ANDPEEK(17023):GOSUB7:IFK=32ORN<15THENGOSUB3
2 A=A-(K=90)+(K=87):B=B-(K=83)+(K=65):GOSUB7:PRINT@238,"ÏßÏ";:PRINT@302,"ÏßÏ";:GOTO1
3 PRINT@32*N+23-N,"Ù";:PRINT@32*N+N+7,"Ö";:PRINT@32*N+23-N,"ß";:PRINT@32*N+N+7,"ß";
4 SH=SH+1:N=N-1:Q=PEEK(9)AND128:POKE49151,0+Q:POKE49151,128-Q:IFN>7THENRETURN
5 IF(U=7ORU=8ORU=9)AND(V=13ORV=14ORV=15ORV=16)THEN?@32*U+V,"ÞÿÜ";:SOUND100,1:HT=HT+1:IFHT=5THEN8
6 GOSUB7:N=15:GOTO1
7 A=A-(A<0):A=A+(A>15):B=B-(B<0):B=B+(B>28):PRINT@32*U+V,"ßßß";:RETURN
8 ?@0,"YOU GOT HIM!  ":SOUND219,9:SOUND241,7:SOUND200,9:SC=INT(10000/(TI+SH)):IFSC>HSTHENHS=SC
9 ?@16,"SCORE"SC:PRINT"HIGH SCORE"HS:PRINT@48,;:INPUT"HIT enter";M$:GOTO0
10 REM USE A,S,W,Z TO STEER
20 REM     SPACE TO FIRE
30 REM 5 HITS TO SHOOT DOWN

Long Listing:

0 CLS6
1 A=5
2 B=14
3 HT=0
4 TI=0
5 SH=0
6 N=15
7 POKE17026,6
100 PRINT@32*A+B,"ÞØÜ";
101 TI=TI+1
102 U=A
103 V=B
104 A=A+2-RND(3)
105 B=B+2-RND(3)
106 K=PEEK(2)ANDPEEK(17023)
107 GOSUB700
108 IFK=32ORN<15THENGOSUB300
200 A=A-(K=90)+(K=87)
201 B=B-(K=83)+(K=65)
202 GOSUB700
203 PRINT@238,"ÏßÏ";
204 PRINT@302,"ÏßÏ";
205 GOTO100
300 PRINT@32*N+23-N,"Ù";
301 PRINT@32*N+N+7,"Ö";
302 PRINT@32*N+23-N,"ß";
303 PRINT@32*N+N+7,"ß";
400 SH=SH+1
401 N=N-1
402 Q=PEEK(9)AND128
403 POKE49151,0+Q
404 POKE49151,128-Q
405 IFN>7THENRETURN
500 IF(U=7ORU=8ORU=9)AND(V=13ORV=14ORV=15ORV=16)THENPRINT@32*U+V,"ÞÿÜ";:SOUND100,1:HT=HT+1:IFHT=5THEN800
600 GOSUB700
601 N=15
602 GOTO100
700 A=A-(A<0)
701 A=A+(A>15)
702 B=B-(B<0)
703 B=B+(B>28)
704 PRINT@32*U+V,"ßßß";
705 RETURN
800 PRINT@0,"YOU GOT HIM!  "
801 SOUND219,9
802 SOUND241,7
803 SOUND200,9
804 SC=INT(10000/(TI+SH))
805 IFSC>HSTHENHS=SC
900 PRINT@16,"SCORE"SC
901 PRINT"HIGH SCORE"HS
902 PRINT@48,;
903 INPUT"HIT enter";M$
904 GOTO0
1000 REM USE A,S,W,Z TO STEER
2000 REM     SPACE TO FIRE
3000 REM 5 HITS TO SHOOT DOWN


I've committed to blogging about my recent projects for RetroChallenge 2017.  You can find more information about the challenge here: http://www.retrochallenge.org/2017/03/rc201704-open-for-entrants.html?spref=fb

P.S. Part of the reason I had my eyes peeled for a simple flight shoot-em-up game was I had been thinking for some time of a game that would re-create the experience of being a tail gunner in a Lancaster Bomber. I envisioned something with guns that would range up and down and left and right with their fire converging at a certain point. You would need to slew your guns to bring them to bear on a moving target. The target would look like the one in Combat Arien, although I think  I had the idea that it would come closer and move farther back. I did create a game with some of these features, but I added a moving star field and it turned into my game Warbirds:



However, the original "Lancaster Turret" idea is still stuck in my head. The reason it did, besides the fact that my dad flew as a Bomb-aimer in a Handley Halifax bomber, is that his younger brother was a tail gunner in a Lancaster. His plan was shot down over France during the D-Day landing bombing campaign. He's now buried in Buran-sur-Oise Communal Cemetery. The recent 100 year anniversary of Vimy reminded me of him. I'd like to dedicate this game to his memory.

No comments:

Post a Comment