Flying Rings

Post Reply
DrChip
Posts: 167
Joined: Wed Oct 22, 2014 3:26 pm
My devices: iPhone 4 to 6+,iPad mini to iPad air 2

Flying Rings

Post by DrChip »

REM
REM flying rings
REM
REM iPhone 6 plus / iOS 8.2 b3
REM I modified my tunnel program to show my
REM son how to make flying rings.
REM if i have time, i'll clean the code.
REM enjoy!

rings=32

DIM x(81)
DIM y(81)
DIM z(81)
DIM tx(81)
DIM ty(81)
DIM orz(81)

ox=Screen_Width()/2
oy=Screen_Height()/2
oz=0
pp=1


FOR a=1 TO 80
READ x(a),y(a),z(a)
orz(a)=z(a)
NEXT a

graphics
graphics clear 0,0,0

loop:
refresh off
graphics clear
GOSUB draw
refresh on
GOTO loop


'Draw the tunnel object!

draw:
' Transform Tunnel object

mc=mc+1
mc2=mc2+1
mmm=80+80*SIN(mc2/15)

FOR a=1 TO 58
sofx=(80*SIN((a+mc)/15))+ox
sofy=(mmm*COS((a+mc)/15))+oy
tx(a)=(x(a)*(z(a)*z(a))/1.5)+sofx
ty(a)=(y(a)*(z(a)*z(a))/1.5)+sofy
z(a)=z(a)+.1
NEXT a


' Draw tunnel object!

FOR a=4 TO rings STEP 4
draw COLOR .50*z(a),.14*z(a),.10*z(a)
draw size a
draw CIRCLE tx(a),ty(a) size z(a)*75
NEXT a


' Move into screen!
IF z(1)>=orz(1)+1 THEN
mc=mc-4
FOR a=1 TO 58
z(a)=orz(a)+.1
NEXT a
END IF

RETURN


' Object Data!

DATA -5,-5,0, 5,-5,0, 5,5,0, -5,5,0
DATA -5,-5,1, 5,-5,1, 5,5,1, -5,5,1
DATA -5,-5,2, 5,-5,2, 5,5,2, -5,5,2
DATA -5,-5,3, 5,-5,3, 5,5,3, -5,5,3
DATA -5,-5,4, 5,-5,4, 5,5,4, -5,5,4
DATA -5,-5,5, 5,-5,5, 5,5,5, -5,5,5
DATA -5,-5,6, 5,-5,6, 5,5,6, -5,5,6
DATA -5,-5,7, 5,-5,7, 5,5,7, -5,5,7
DATA -5,-5,8, 5,-5,8, 5,5,8, -5,5,8
DATA -5,-5,9, 5,-5,9, 5,5,9, -5,5,9
DATA -5,-5,10, 5,-5,10, 5,5,10, -5,5,10
DATA -5,-5,11, 5,-5,11, 5,5,11, -5,5,11
DATA -5,-5,12, 5,-5,12, 5,5,12, -5,5,12
DATA -5,-5,13, 5,-5,13, 5,5,13, -5,5,13
DATA -5,-5,14, 5,-5,14, 5,5,14, -5,5,14
DATA -5,-5,15, 5,-5,15, 5,5,15, -5,5,15
DATA -5,-5,16, 5,-5,16, 5,5,16, -5,5,16
DATA -5,-5,17, 5,-5,17, 5,5,17, -5,5,17
DATA -5,-5,18, 5,-5,18, 5,5,18, -5,5,18
DATA -5,-5,19, 5,-5,19, 5,5,19, -5,5,19
Attachments
image.jpg
image.jpg (191.47 KiB) Viewed 1703 times
image.jpg
image.jpg (227.22 KiB) Viewed 1703 times

Post Reply