home *** CD-ROM | disk | FTP | other *** search
- CLEAR , , 2000: DEFINT A-Z: SCREEN 7: CLS
- DEF FNR (X) = INT(RND * X) + 1
- DIM E1(150), E2(50), E3(15), S1(500) ' dim arrays
- DIM S2(500), F1(70), F2(40), R1(200)
- DIM CX(50), CY(50), CT(50)
- DIM TEMP(500)
- DIM SX(50), SY(50), ST(50)
-
-
- CLS : PCOPY 0, 2 'prepare our "background" page
- FOR I = 1 TO 50 'sprinkle some stars
- SX(I) = FNR(319): SY(I) = FNR(199)
- ST(I) = FNR(14)
- NEXT
-
-
- ED = 0: ET = 0: TOG = 0
- DO
- PCOPY 2, 0 'copy background to template
- FOR I = 1 TO 50 'move & display stars
- SELECT CASE ST(I)
- CASE 1
- C = 12
- CASE 2
- C = 2
- CASE 3
- C = 3
- CASE 4
- C = 4
- CASE 5
- C = 5
- CASE 6
- C = 6
- CASE 7
- C = 7
- CASE 8
- CASE 9
- C = 9
- CASE 10
- C = 10
- CASE 11
- C = 11
- CASE 12
- C = 12
- CASE 13
- C = 15
- END SELECT
-
- CIRCLE (SX(I), SY(I)), 2, C
- ' PAINT (SX(I), SY(I)), C
- SX(I) = SX(I) - ST(I)
- IF SX(I) < 0 THEN
- SX(I) = 319: SY(I) = FNR(199)
- ST(I) = FNR(15)
- END IF
-
- NEXT
-
- PCOPY 0, 1 'copy template to viewing screen
-
-
- LOOP UNTIL INKEY$ <> ""
- CLS : PCOPY 0, 1 'clear active page
- END
-
- SUB FONT (a$, X%, Y%, stepX%, stepY%, CO%, Background%, SHADOW%)
-
- END SUB
-
- ' PUT2P - PUT Type II:
- ' Clipping PUT routine.
- '
- SUB PUT2P (X, Y, AR()) STATIC
- IF X < 0 OR Y < 0 THEN EXIT SUB 'off screen
- IF X + AR(0) < 320 AND Y + AR(1) < 200 THEN
- PUT (X, Y), AR, PSET: EXIT SUB
- END IF 'already on screen
- IF X > (320 - AR(0)) THEN VL = 320 - X ELSE VL = AR(0)
- IF VL < 1 THEN EXIT SUB 'no need
- IF Y > (200 - AR(1)) THEN VL2 = 200 - Y ELSE VL2 = AR(1)
- IF VL2 < 1 THEN EXIT SUB 'no need
- SAR = AR(0): SAR1 = AR(1) 'hold copy
- AR(0) = VL: AR(1) = VL2
- PUT (X, Y), AR, PSET 'put modified array
- AR(0) = SAR: AR(1) = SAR1 'restore altered bytes
- END SUB
-
-