NLAW (MSX 2) by Nick Shcherbyna
A downloadable game
Being an Ukrainian, I was uncertain about the participation in this year's
BASIC 10-liner Contest. While my city of Lviv is considered safe at this
moment, there are several air raid sirens per day, and four russian cruise
missiles hit some facility in the past days.
However, no kremlin's bastard can dictate my schedule, so let me submit an
EXTREME-256 game for MSX2/MSX2+/Turbo R, called NLAW. I dedicate this game
to brave ukrainian soldiers who are defending our freedom.
The Next Generation Light Antitank Weapon is a fire-and-forget, lightweight
shoulder-fired disposable (single-shot) missile system, designed for use by
infantry. The missile is guided by calculation based on Predicted Line of
Sight, and can carry Out a Top Attack or Direct Attack on an armoured
vehicle. NLAW has its origins in a joint British–Swedish project. Today it
is widely used by Ukrainian army fighting against the russian offensive.
You are a brave Ukrainian soldier of Territorial Defense Forces, seeing an
approaching russian tank battalion of "kantemirovskaya" Division. Good news
are that they are out of ammo (supply chains were destroyed by Ukrainians),
and you have got a lot of NLAWs in your trench. Take NLAW from either side,
aim, fire, and repeat again until the last na[Z]i tank is burned out! Next
tank company moves faster than the previous.
Controls: [↑] — move up, [↓] — move down, [SPACE] — fire.
0DEFINTA-Y:D=0:T=0:SOUND7,0:COLOR3,1,1:SCREEN5,2:CLS:READT$,U$,V$:OPEN"GRP:"AS1:PSET(112,92),0:?#1,T$:FORI=0TO15:S$="":FORJ=1TO32:READN:PSET(ABS(N),12*I),12:IFN<0THENN=-N:S$=S$+MID$(SPRITE$(I1),J,N+1)ELSEV=NAND255:N=N/256:S$=S$+STRING$(N+1,V):DATANLAW:: 1J=J+N:NEXTJ:SPRITE$(I)=S$:Z=I*ATN(1)/8:M=20*SIN(Z):FORJ=16*COS(Z)TO191STEP5+N:PSET(M,J),12:NEXT:NEXTI:PSET(112,92),0:COLOR1:?#1,T$:PUTSPRITE8,(0,0),3,13:PUTSPRITE9,(0,176),3,13:FORI=1TO5:READM,N,F,C:LINE(M,N)-(M+11,N+F),C,BF:NEXT:C=3:N=0:P=88:X=255:Y=P: 2J=STICK(0):F=(PAND4)=0:PUTSPRITE4,(0,P),C,12+(8+F)*(J=5)-N+(4+F)*(J=1)-N:P=P+4*(J=1ANDP>0)-4*(J=5ANDP<176):N=(NORP=0ORP=176)ANDD<16:PUTSPRITE5,(D,M),14ANDD>0,15:SOUND8,D>0AND7:D=D>0AND(D+8)AND255:M=M+(D>=16ANDD<=112):IFSTRIG(0)ANDNANDD=0THENN=0:M=P:D=8: 3I=X:FORJ=0TO3:K=I<=255ANDI>=-32:PUTSPRITEJ,(I,Y),-K-K,J:I=I+16:NEXT:PSET(X+32,Y+15+2*RND(1)),-12*(RND(1)>.5):X=X-T/10-1:F=X>-16ORABS(Y-P)>8:C=CANDF:IFX<-64THENPLAYU$:FORJ=0TO1:FORI=193TO198:LINE(2,I)-(13,I),POINT(242,I):NEXT:J=-STRIG(0):NEXT:RUN:'Glory: 4IFD<X+29ORD>X+51ORM<Y-12ORM>YTHEN2ELSEPUTSPRITE5,,0:FORR=0TO15:CIRCLE(D+8,M+6),R,8:SOUND8,R:NEXT:FORR=15TO0STEP-1:J=RAND3:PUTSPRITEJ,(16*J+X,Y),R/4+8,J:CIRCLE(D+8,M+6),R,1:NEXT:D=0:X=255:Y=160*RND(1)+16:T=T+1:LINE(35,193)-(6*T+35,198),8,BF:IFT<31THEN 2: 5PLAYV$:FORJ=0TO3:PUTSPRITEJ,,0,J:NEXT:FORJ=0TO1:FORI=193TO198:LINE(242,I)-(253,I),POINT(2,I):NEXT:J=-STRIG(0):NEXT:RUN:DATAV15L8GEL4AL2E,V15L8CL4FEGL8CFGABL4C5L8F,768,511,3328,495,2304,-3,383,,1,127,255,127,63,23,15,7,3,7,-1,3,503,5,1279,414,12,255:'UA: 6:DATA255,3,119,239,223,191,80,254,253,251,240,255,377,48,255,8,200,255,477,255,85,-2,127,255,487,195,255,256,224,192,176,48,,1279,158,159,14,252,1024,6,15,239,246,248,240,192,128,512,1,3,258,7,15,31,27,3,2,3,519,270,192,224,32,40,112,248,508,236,172,496 7DATA120,56,-1,-6,31,27,26,263,15,14,256,-6,236,224,160,224,240,368,312,-1,58,70,699,71,59,2,3,519,270,-6,252,236,172,496,120,56,256,-9,263,15,14,256,-6,236,224,160,224,240,368,312,3,263,23,12,23,59,61,55,52,271,30,28,-1,128,704,96,240,248,216,192,64,192 8:DATA736,368,-6,53,7,4,7,15,270,284,-6,248,216,88,480,240,112,256,-6,61,55,52,271,30,28,256,-1,220,254,119,235,247,254,220,64,192,736,368,-6,53,7,4,7,15,270,284,-9,480,240,112,256,-2,6,14,539,15,519,15,62,60,48,-1,64,32,68,252,255,244,248,88,192,-2,312: 9:DATA512,224,159,245,253,255,224,2048,6,57,247,31,511,15,6,1280,3,263,230,-3,239,519,15,62,60,48,128,192,70,-1,63,-1,207,70,192,224,240,112,312,512,98,127,128,255,127,98,2560,254,41,255,254,1792,2,193,2,5,2,196,2,11,242,193,1,15,242,195,1,4,242,197,1,8:
Line 0: Screen and variable setup. Sprite decoder (described above) intermixed with the field drawing code, see PSET. D is the horizontal missile coordinate, T is the number of tanks destroyed.
Line 1: Sprite decoder (described above) intermixed with the trench drawing code, see PSET. Draw both NLAW supplies. Draw Ukrainian and russian flags. Initialize variables. C is the player color/visibility, N is the NLAW flag, P is the player's vertical coordinate, X and Y are tank coordinates.
Line 2: Poll joystick (i.e., arrow keys). F is the player step. Draw the player sprite according to direction, step, and NLAW presence. Modify the player position. Draw the missile sprite (transparent if not launched). Play the sound effect. Modify NLAW coordinates D and M. Poll the button (i.e., space bar). Launch the missile if allowed.
Line 3: Draw the T-90 tank (4 sprites) and its trail (see PSET). Modify the tank's position. F is the tank/player collision, hide the player if so. If the left side is approached then play the Game Over music, replace the Ukrainian flag, and wait until [SPACE] is pressed, then restart.
Line 4: Loop to 2 if tank is not hit by the missile. Otherwise hide the missile, draw the explosion (see CIRCLE), and play the sound effect. Burn the tank (i.e., change colors in a loop). Initialize next tank's coordinates. Update the progress bar, loop to 2 if there are tanks left.
Line 5: Play the Game Over music, raise the Ukrainian flag, and wait until [SPACE] is pressed, then restart. DATA for Game Over and Victory music. Sprites (begin).
Line 6: Sprites (continue).
Line 7: Sprites (continue).
Line 8: Sprites (continue).
Line 9: Sprites (end). Ukrainian and russian flag stripes (starting 2,193,2,5)
— x, y, height - 1, color.
You can use the online emulator https://webmsx.org/ to play. Select Machine
in Settings (MSX Turbo R for faster gameplay), copy the code to clipboard,
press [Alt]-[V] and [Ctrl]-[V]. Finally press [F5] to RUN
Leave a comment
Log in with itch.io to leave a comment.