	IF1
INCLUDE COMDEF.INC              ; Include command definition
        ENDIF
VOL     EQU     0               ; Define volume number
LOGIC   SEGMENT BYTE
        ASSUME  CS:LOGIC
        BEGIN                   ; Start up

;  logic20 ; мигание звезд
; заимствовано из игры In Search Of Lost Planet
; см. комментарии в log10.asm

        if_
          isset           5 
        else_ NotNr
	 
          load_view      111 ; звездочки
	            
          animate_obj    12          
          ignore_horizon 12          
          random          0, 156,  38    
          random         50, 160,  39    
          position_v     12,  38,  39    
          set_view       12,  111     
          set_cel        12,   0     
          set_priority   12,   4     
          draw           12          
          end_of_loop    12, 210
	       
          animate_obj    13          
          ignore_horizon 13          
          random          0, 156,  38
          random         50, 160,  39
          position_v     13,  38,  39
          set_view       13,  111     
          set_cel        13,   3     
          set_priority   13,   4     
          draw           13          
          end_of_loop    13, 211
	       
          animate_obj    14          
          ignore_horizon 14          
          random          0, 156,  38
          random         50, 160,  39
          position_v     14,  38,  39
          set_view       14,  111     
          set_loop       14,   1     
          set_cel        14,   0        
          set_priority   14,   4        
          draw           14          
          end_of_loop    14, 212
	          
          animate_obj    15          
          ignore_horizon 15          
          random          0, 156,  38        
          random         50, 160,  39        
          position_v     15,  38,  39        
          set_view       15,  111        
          set_loop       15,   1        
          set_cel        15,   3        
          set_priority   15,   4        
          draw           15          
          end_of_loop    15, 213
	          
          return
	                              
NotNr:  if_
          isset                210 
        else_ L185
 
          random 10, 240,  38 
          random 10, 240,  39 
          addv   38,  40 
          addv   39,  41
 
          if_
            greatern 38, 159 
          else_ L165
 
            subn 38, 160 
L165 :      if_
              greatern 39, 167 
            else_ L175
 
              subn            39, 168 
L175 :        reposition_to_v 12,  38,  39 
              set_cel         12,   0 
              end_of_loop     12, 210
	   
L185 :  if_
          isset 211 
        else_ L235
 
          random 10, 240,  38 
          random 10, 240,  39 
          addv   38,  40 
          addv   39,  41
 
          if_
            greatern 38, 159 
          else_ L215
 
            subn 38, 160 
L215 :      if_
              greatern 39, 167 
            else_ L225
 
              subn            39, 168 
L225 :        reposition_to_v 13,  38,  39 
              set_cel         13,   0 
              end_of_loop     13, 211 

L235 :  if_
          isset 212 
        else_ L285
 
          random 10, 240,  38 
          random 10, 240,  39 
          addv   38,  40 
          addv   39,  41
 
          if_
            greatern 38, 159 
          else_ L265
 
            subn 38, 160 
L265 :      if_
              greatern 39, 167 
            else_ L275
 
              subn            39, 168 
L275 :        reposition_to_v 14,  38,  39 
              set_cel         14,   0 
              end_of_loop     14, 212 

L285 :  if_
          isset 213 
        else_ L335
	 
          random 10, 240,  38 
          random 10, 240,  39 
          addv   38,  40 
          addv   39,  41 

          if_
            greatern 38, 159 
          else_ L315
 
            subn 38, 160 
L315 :      if_
              greatern 39, 167 
            else_ L325
 
              subn            39, 168 
L325 :        reposition_to_v 15,  38,  39 
              set_cel         15,   0 
              end_of_loop     15, 213
 
L335 :  return

         messages 0

VERYEND EQU $
LOGIC   ENDS
        END