DECLARE SUB tankIMAGE (X, y, cc)
DECLARE SUB explode (cx, cy)
DECLARE SUB slep ()

 
   GOTO openI
11
contin:
 SCREEN 13
 


' +++++++++++++++++++++++++++++++++++++++++++++++
' This Is The way to paste tank image
' TANKIMAGE Xcordinate, Ycordinate, color
' ...............................................

' This Is tank Image cordinate
DATA 00,00,00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,09,09,09,09,00,09,00,00,00
DATA 00,09,09,09,09,09,09,09,09,09,09,00
DATA 15,09,09,09,09,09,09,09,09,09,09,15
DATA 12,06,03,03,06,03,03,06,03,03,06,09
DATA 15,12,03,03,06,03,03,06,03,03,09,15
DATA 15,07,09,09,09,09,09,09,09,09,15,15
' +++++++++++++++++++++++++++++++++++++++++++++++++

' TANKIMAGE 100, 100, 1


' mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmountain


23
 CLS
 '-------------------------------- moon
 FOR gh = 1 TO 30
 CIRCLE (280, 40), gh, 14
   NEXT
 
      RANDOMIZE TIMER
      ghi = FIX(RND * 20) + 30
     FOR gh = 1 TO ghi
      CIRCLE (240, 40), gh, 0
        NEXT

 X = 15: OUT &H3C8, X: OUT &H3C9, X: OUT &H3C9, X: OUT &H3C9, X


  X = 0
    y = 100
start:
  'a$ = INKEY$
 
  
   FOR speed = 1 TO 2
    a$ = "6": zx = zx + .1
      NEXT speed
TopSpeed:

   RANDOMIZE TIMER
   r = FIX(RND * 10)
      IF r = 2 THEN a$ = "2"
      IF r = 8 THEN a$ = "8"

    IF a$ = "2" THEN zy = zy + 1.8
    IF a$ = "8" THEN zy = zy - 1.8
     zx = zx - .05

   X = X + zx
    y = y + zy
     IF y > 160 THEN y = 160
   
     IF POINT(X, y) = -1 THEN GOTO ched:
      
   GOTO ChedFIN:

ched:
     IF X < 300 THEN CLEAR : GOTO 23
    
      
ChedFIN:

     PSET (X, y)
    
       IF ay > 0 THEN
    
      'LOCATE 1, 1: PRINT "RANDOMIZE LANDSCAPE"
      LINE (ax, ay)-(X, y)
          END IF

       ax = X
        ay = y
       'FOR delay = 1 TO 8000: NEXT delay
      IF X > 400 THEN GOTO checkLAND:
      GOTO start


checkLAND:

 IF y > 10 THEN GOTO fdf:
   CLEAR
    GOTO 23

fdf:
  IF y < 150 THEN GOTO landok:
     CLEAR
      GOTO 23

landok:

 'LOCATE 1, 1: PRINT "LANDSCAPE  OK           "
   PSET (0, 190)
    PSET (320, 190)
     dy = 190

doit:

  PSET (dx, dy)
    dy = dy - 1
     IF POINT(dx, dy) = 15 THEN dx = dx + 1: dy = 190
      IF POINT(dx, dy) = -1 THEN dx = dx + 1: dy = 190
      IF dx > 319 THEN GOTO stopitI:
     GOTO doit:

stopitI:

   rr = FIX(RND * 230) + 40
   IF rr < tankAlocateX + 90 GOTO noy:
   GOTO stopit

noy:
  IF rr > tankAlocateX - 90 THEN GOTO stopitI:

stopit:

  
    n = n + 1

   IF POINT(rr, 2 + n) = 15 THEN GOTO nextStep:
    GOTO stopit:
nextStep:
   IF POINT(rr + 6, 6 + n) = 15 THEN GOTO ok:
      GOTO stopit:

ok:
 
'END-  mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmountain
   
  ' stars
  FOR rn = 1 TO 50
    xxx = FIX(RND * 320)
    yyy = FIX(RND * 190)
    IF POINT(xxx, yyy) = 0 THEN PSET (xxx, yyy), 23
          NEXT
   
    tankIMAGE rr, n - 4, 1 + hgi
    
     
      IF hgi = 1 THEN GOTO EndItI:
        RESTORE
     hgi = 1
      tankAlocateX = rr
        tankAlocateY = n - 4
         n = 0
       GOTO stopitI:

EndItI:
  
 

tankBlocateX = rr
  tankBlocateY = n - 4
 
  spointx = tankAlocateX + 6
  spointy = tankAlocateY + 2
  LINE (spointx, spointy)-(spointx + 10 * COS(a), spointy + 10 * SIN(a)), 71


a$ = "no"
spointx = tankBlocateX + 6
spointy = tankBlocateY + 2
  

' ------------------------------------------------- -----SHOOT
  
star:


coi:
    
  LINE (spointx, spointy)-(spointx + 10 * COS(a), spointy + 10 * SIN(a)), 71
    COLOR 14
    LOCATE 22, 2: PRINT "ANGLE:          "
    LOCATE 22, 10: PRINT FIX(angle)
    LOCATE 22, 20: PRINT "POWER:              "
    LOCATE 22, 26: PRINT power
   
    IF a$ = "no" THEN LOCATE 23, 2: COLOR 11: PRINT "Blue tank turn  "
    IF a$ = "yes" THEN LOCATE 23, 2: COLOR 10: PRINT "Greeen tank turn"
     COLOR 14
     LOCATE 23, 20: PRINT "                    "
    LOCATE 23, 20: PRINT "Wind: "; wind$


skipop:

26
   u$ = INKEY$: IF u$ = "" THEN GOTO 26
  
     IF u$ = CHR$(0) + "K" THEN u$ = "4"
     IF u$ = CHR$(0) + "M" THEN u$ = "6"
    IF u$ = CHR$(13) THEN GOTO fire:
    IF u$ = "4" THEN a = a - .1
    IF u$ = "6" THEN a = a + .1
    IF u$ = CHR$(13) THEN GOTO fire
    IF u$ = "+" THEN power = power + .3
    IF u$ = "-" THEN power = power - .3
     IF power < 0 THEN power = 0
     IF power > 8 THEN power = 8

     IF a > 0 THEN a = 0
      IF a < -3.099999 THEN a = -3.099999
    
      angle = 0
      FOR an = 0 TO a STEP -.1
         angle = angle + 5.625
             NEXT an

    LINE (spointx, spointy)-(spointx + 10 * COS(a + .1), spointy + 10 * SIN(a + .1)), 0
     LINE (spointx, spointy)-(spointx + 10 * COS(a - .1), spointy + 10 * SIN(a - .1)), 0
 
   GOTO star:
fire:
 
 balllocate = 10     ' In balllocate U chage power fire
 g = 2   ' graviry
 
     IF a$ = "no" THEN az = a: apower = power
     IF a$ = "yes" THEN bz = a: bpower = power

ss:

 IF POINT(spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g) = -1 AND (spointy + balllocate * SIN(a) + g) > 0 THEN GOTO changeFire
   IF POINT(spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g) = 23 THEN GOTO skip:
   IF POINT(spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g) = 71 THEN GOTO skip:
   IF POINT(spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g) = 14 THEN GOTO skip:
   IF POINT(spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g) > 0 THEN GOSUB okfire:
skip:
  IF POINT(spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g) = 15 THEN GOTO changeFire:

   z = FIX(RND * 100)
  PSET (spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g), z
       slep
     PSET (spointx + balllocate * COS(a), spointy + balllocate * SIN(a) + g), 0
 
     
  g = g * 1.08
    
    

   balllocate = balllocate + power + wind
  
   GOTO ss:

okfire:
 cx = spointx + balllocate * COS(a)
 cy = spointy + balllocate * SIN(a) + g
 IF POINT(cx, cy) <> 15 THEN GOTO boko:
  GOTO fgfg:
boko:
  'IF a$ = "yes" THEN explode tankAlocateX, tankAlocateY
   'IF a$ = "no" THEN explode tankBlocateX, tankBlocateY
     explode cx, cy

fgfg:
  RETURN

changeFire:
    RANDOMIZE TIMER
   wind = FIX(RND * 5)
  
  IF angle < 90 THEN
   IF wind = 0 THEN wind = 0: wind$ = "--"
   IF wind = 1 THEN wind = -.1: wind$ = "<  0.1"
   IF wind = 2 THEN wind = -.2: wind$ = "<< 0.2"
   IF wind = 3 THEN wind = .1: wind$ = ">  0.1"
   IF wind = 4 THEN wind = .2: wind$ = ">> 0.2"
    END IF
  
   IF angle > 90 THEN
   IF wind = 0 THEN wind = 0: wind$ = "--"
   IF wind = 1 THEN wind = -.1: wind$ = ">  0.1"
   IF wind = 2 THEN wind = -.2: wind$ = ">> 0.2"
   IF wind = 3 THEN wind = .1: wind$ = "<  0.1"
   IF wind = 4 THEN wind = .2: wind$ = "<< 0.2"
      END IF

 IF a$ = "yes" THEN
spointx = tankBlocateX + 6
spointy = tankBlocateY + 2
  a = az
  power = apower
  a$ = "no": GOTO coi
 END IF
IF a$ = "no" THEN
a$ = "yes"
spointx = tankAlocateX + 6
spointy = tankAlocateY + 2
 a = bz
 power = bpower
 END IF
  GOTO coi

openI:
 SCREEN 13
openIb:

   COLOR 3
   LOCATE 1, 1: PRINT "            Tank Wars Help            "
   LOCATE 2, 1: PRINT
   COLOR 23
   COLOR 4
   LOCATE 3, 1: PRINT "How to use keys"
   a = a + 1: IF a > 10 THEN a = 1
   COLOR 1
   LOCATE 4, 1: PRINT "--------------------------------------"
    slep
   COLOR a + 2
   LOCATE 5, 1: PRINT "ANGLE  ---->  Arrows (6 Right, 4 Left)"
    slep
   COLOR a + 3
   LOCATE 6, 1: PRINT "POWER  ---->  +  -                    "
    slep
   COLOR a + 4
   LOCATE 7, 1: PRINT "FIRE   ---->  Enter"
   COLOR 1
   LOCATE 8, 1: PRINT "--------------------------------------"
   COLOR 1
   LOCATE 9, 1: PRINT ""
   LOCATE 10, 1: PRINT "           1999 Itamar Bresler"
   LOCATE 11, 1: PRINT
    COLOR 3
   LOCATE 12, 1: PRINT "    Press Enter To Start The Game     "
s:
    u$ = INKEY$: IF u$ = CHR$(13) THEN CLS : RUN 11
     GOTO openIb:

SUB explode (cx, cy)
 centerX = cx: centerY = cy
  

 n = 6

again:
   FOR blow = 1 TO 2
    FOR a = 0 TO 10
   CIRCLE (centerX, centerY), a, n
      slep
       NEXT

  FOR a = 0 TO 20
 CIRCLE (centerX, centerY), a, 4
   slep
     CIRCLE (centerX + ri, centerY + ri), a, 0
    NEXT a
     NEXT
       IF n = 8 THEN GOTO nextIt:
      n = 8
  GOTO again:
nextIt:

    LOCATE 1, 1: PRINT "                "
    LOCATE 2, 1: PRINT "                "
    LOCATE 3, 1: PRINT "                "
    LOCATE 4, 1: PRINT "                "
    
dfh:
      FOR a = 1 TO 200
       slep
       COLOR a

      u$ = INKEY$
       IF UCASE$(u$) = "Y" THEN RUN 11:
       IF UCASE$(u$) = "N" THEN SYSTEM
      LOCATE 1, 1: PRINT "  Do U want to play angain ? Y/N"
          NEXT a
      GOTO dfh
  

END SUB

SUB slep
 t = TIMER


sg:
 IF TIMER - t > .005 THEN EXIT SUB

GOTO sg


END SUB

SUB tankIMAGE (X, y, cc)
      LINE (X + 1, 0)-(X + 12, y), 0, BF

 FOR yy = 1 TO 8
    FOR xx = 1 TO 12
   READ c
     
     IF c > 0 THEN
     PSET (xx + X, yy + y), c + cc
      END IF
     IF c = 0 THEN
      PSET (xx + X, yy + y), c
       END IF

    NEXT
     NEXT
      
     


END SUB

