home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
games
/
hj.amos
/
hj.amosSourceCode
Wrap
AMOS Source Code
|
1991-06-13
|
2KB
|
53 lines
'---------------------------------------------------------------------------
'A simple pattern generator based on the central part of the Sentex demo.
'Tables of sines and cosines are first put into integer arrays.
'This is faster than using the trig functions in the floating point library.
'A surface of the type
'f=h1*sin(a1*x+b1*y+c1)+h2*sin(a2*x+b2*y+c2)+...
'g=j1*cos(a1*x+b1*y+c1)+j2*cos(a2*x+b2*y+c2)+...
'is drawn over a small range.
'Only two or three colours are used,
'the remaining registers being set to zero.
'When the colours are cycled the coloured lines on the surface will
'appear to move.
'While one pattern is visibly cycled on the front screen a new pattern
'is being drawn on the rear screen.
'---------------------------------------------------------------------------
Randomize Timer
Degree
Dim C(360),S(360)
For I=0 To 360 : C(I)=10000*Cos(I) : S(I)=10000*Sin(I) : Next I
Screen Open 0,320,256,32,Lowres : Flash Off : Hide
Palette $0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0
Cls 0
Screen Open 1,320,256,32,Lowres : Flash Off : Hide
Palette $0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0
Cls 0
Load "ap:rio.abk"
Led Off : Music 1 : Tempo 13
Do
Screen 0 : Gosub NET : Screen 1 : Shift Off : Screen 0 : Shift Up 1,1,30,1 : Screen To Front 0
Screen 1 : Gosub NET : Screen 0 : Shift Off : Screen 1 : Shift Up 1,1,30,1 : Screen To Front 1
Loop
NET:
Cls 0
Palette $0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$FFF,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0
For I=1 To 21 Step 10 : Colour I,Rnd(4095) : Next I
ARG1=Rnd(359) : ARG2=Rnd(359) : ARG3=Rnd(359) : C=1 : A1=0
While A1*A2*A3=0 or B1*B2*B3=0
A1=Rnd(12)-6 : A2=Rnd(12)-6 : B1=Rnd(12)-6 : B2=Rnd(12)-6
A3=Rnd(12)-6 : B3=Rnd(12)-6
Wend
R1=Rnd(50) : R2=Rnd(50) : R3=160-R1-R2
R4=Rnd(60) : R5=Rnd(60) : R6=128-R4-R5
For I=0 To 19
Add ARG1,A1,0 To 359 : Add ARG2,A2,0 To 359 : Add ARG3,A3,0 To 359
For J=0 To 359
Add ARG1,B1,0 To 359 : Add ARG2,B2,0 To 359 : Add ARG3,B3,0 To 359
Add C,1,1 To 30
X=160+(R1*C(ARG1)+R2*C(ARG2)+R3*C(ARG3))/10000
Y=128+(R4*S(ARG1)+R5*S(ARG2)+R6*S(ARG3))/10000
Plot X,Y,C
Next J
Next I
Return