CODINGLISTINGS ★ ROTATING SPHERE ★

Rotating SphereCoding Listings
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

320 WHILE INKEY(16)<>0
330 MODE 2:INPUT "Glittering or rotating?(g/r)",what$:IF LOWER$(what$)="g" THEN code=1 ELSE code=0
335 INPUT "Width?(0-320)",xsize:INPUT "Height?(0-180)",ysize:num=xsize:secondnum=ysize
340 INPUT "Circular background?(y/n)",back$:IF back$="y" THEN back=13 ELSE back=1
345 MODE 0
350 GOSUB 2340::'make inks visible
360 DEG
370 first=2:last=15
380 IF back=1 THEN GOSUB 1220
460 ORIGIN 320,200
470 IF back=13 THEN GOSUB 2390::'draw circular background
480 GOSUB 2000::'draw surround to sphere
490 GOSUB 2080
500 GOSUB 1790::'blank out inks
510 IF first=2 THEN GOSUB 1840 ELSE IF first=15 THEN GOSUB 1930::'animate
520 WEND
530 END
1220 col=2
1230 FOR strip=0 TO 640 STEP 4
1240 MOVE strip,0
1250 DRAWR 0,400,col
1260 col=col+1:IF col=16 THEN col=2
1270 NEXT strip
1280 RETURN
1790 REM *** blank inks ***
1800 FOR blank=2 TO 15
1810 INK blank,0
1820 NEXT blank
1830 RETURN
1840 REM *** ink swap ***
1850 WHILE INKEY$=""
1860 FOR effect=2 TO 15
1870 INK effect,26
1880 CALL &BD19:REM put 'FRAME' here if you have a 664 or 6128
1890 INK effect,0
1900 NEXT effect
1910 WEND
1920 RETURN
1930 WHILE INKEY$=""
1940 FOR effect=15 TO 2 STEP -1
1950 INK effect,26
1960 CALL &BD19:REM put 'FRAME' here if you have a 664 or 6128
1970 INK effect,0
1980 NEXT effect
1990 WEND
1995 RETURN
2000 REM *** draw bordering circle to give solidity ***
2010 INK 1,26:PRINT CHR$(23);CHR$(0);
2020 FOR surround=0 TO 360 STEP 8
2030 x=SIN(surround)*(xsize+4)
2040 y=COS(surround)*(ysize+2)
2050 IF surround=0 THEN MOVE x,y ELSE DRAW x,y,1
2060 NEXT surround
2070 RETURN
2080 REM *** draw inside lines ***
2090 col=2
2100 PRINT CHR$(23);CHR$(code);
2110 WHILE xsize>-num
2120 FOR inside=0 TO 180 STEP 12
2130 x=SIN(inside)*xsize
2140 y=COS(inside)*ysize
2150 IF inside=0 THEN MOVE x,y ELSE DRAW x,y,col
2160 NEXT inside
2170 col=col+1:IF col=16 THEN col=2
2180 xsize=xsize-4
2190 WEND
2200 RETURN
2340 REM *** make inks visible ***
2350 FOR visible=0 TO 15
2360 INK visible,visible
2370 NEXT visible
2380 RETURN
2390 REM *** circular background ***
2400 col=2:PRINT CHR$(23);CHR$(0);
2410 xcirc=xsize+8
2420 ycirc=ysize+4
2430 WHILE xcirc<460
2440 FOR angle=0 TO 360 STEP 12
2450 x=SIN(angle)*xcirc
2460 y=COS(angle)*ycirc
2470 IF angle=0 THEN MOVE x,y ELSE DRAW x,y,col
2480 NEXT angle
2490 col=col+1:IF col=16 THEN col=2
2500 xcirc=xcirc+4
2510 ycirc=ycirc+2
2520 WEND
2530 RETURN

★ PUBLISHER: Amstrad Action
★ YEAR: 1986
★ CONFIG: 64K + AMSDOS
★ AUTHOR(S): ???

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Coding Src's » Interlace Demo
» Coding Src's » Scrolling : Rápido, rápido...
» Coding Src's » Animation (CPC Infos)
» Coding Src's » Random Numbers (Computing with the Amstrad)
» Coding Src's » 3D Surfaces (CPC Computing)
» Coding Src's » Ziehharmonika Effekt
Je participe au site:

» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop
Page créée en 118 millisecondes et consultée 1210 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.