Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Have fun
Message
De
22/05/2003 00:06:57
 
 
À
21/05/2003 23:50:59
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00791118
Message ID:
00791453
Vues:
25
WOW.

Very nice, LOL. Spirographs were very popular here about 20 years ago.

I'm outta here for about 5 days, so I expect when I get back to see revolving pentagonal dodecahedrons!


>This version let's you alter the size of the circles!
>
>
>SET ESCAPE ON
>ON ESCAPE DO iquit
>
>*Window Dimensions
>LOCAL lnRow1, lnCol1, lnRow2, lnCol2
>lnRow1 = 10
>lnCol1 = 10
>lnRow2 = 30
>lnCol2 = 30
>
>*mywnd dimensions
>LOCAL lnWidth, lnHeight
>lnWidth = 600
>lnHeight = 600
>
>
>*Distance between consecutive circles
>LOCAL xDir, yDir
>xdir = 1
>ydir = 1
>
>*Initial starting point.
>LOCAL x,y
>x=300
>y=150
>
>*Initial Starting Angle
>LOCAL Angle
>Angle = 0
>
>*Bounce boundaries
>LOCAL lnMinX, lnMaxX, lnMinY, lnMaxY
>lnMinX = 100
>lnMaxX = 200
>lnMinY = 100
>lnMaxY = 200
>
>*Size of the circles
>lnSize = 100
>
>*Precalculate COS and SIN
>LOCAL lnI
>LOCAL ARRAY laCOS[360 + 270], laSIN[360 + 270]
>FOR lnI = 1 TO 360 + 270
>  laCOS[m.lnI] = COS(DTOR(m.lnI))
>  laSIN[m.lnI] = SIN(DTOR(m.lnI))
>ENDFOR lnI
>
>DEFINE WINDOW Superwnd FROM m.lnRow1,m.lnCol1 TO m.lnRow2, m.lnCol2 NAME mywnd
>
>WITH mywnd
>  .WIDTH = m.lnWidth
>  .HEIGHT = m.lnHeight
>  .AUTOCENTER=.T.
>  SHOW WINDOW Superwnd
>  SET CURSOR OFF
>  ACTIVATE WINDOW Superwnd
>  ACTIVATE SCREEN
>  WAIT WINDOW NOWA "Hit ESC to terminate..."
>
>  DO WHILE .T.
>
>    .FORECOLOR=65535
>    .CIRCLE(m.lnSize, m.x + m.y * laCOS[m.Angle + 1], m.x + m.y * laSIN[m.Angle + 1])
>
>    .FORECOLOR=65408
>    .CIRCLE(m.lnSize, m.x - m.y * laCOS[m.Angle + 1], m.x - m.y * laSIN[m.Angle + 1])
>
>    .FORECOLOR=16711680
>    .CIRCLE(m.lnSize, m.x + m.y * laCOS[m.Angle + 91], m.x + m.y * laSIN[m.Angle + 91])
>
>    .FORECOLOR=255
>    .CIRCLE(m.lnSize, m.x + m.y * laCOS[m.Angle + 271], m.x + m.y * laSIN[m.Angle + 271])
>
>    *Advance drawing angle.
>    IF m.Angle = 359
>      Angle = 0
>     ELSE
>      Angle = m.Angle + 1
>    ENDIF
>
>    *Bounce the circles off the sides of the bounce area
>    *by moving the initial center point around.
>    IF m.x < m.lnMinX OR m.x > m.lnMaxX
>      xdir = -1 * m.xdir
>    ENDIF
>    x = m.x + m.xdir
>
>    IF m.y < m.lnMinY OR m.y > m.lnMaxY
>      ydir = -1 * m.ydir
>    ENDIF
>    y = m.y + m.ydir
>
>  ENDDO
>ENDWITH
>
>DO iquit
>
>*-------------
>  PROCEDURE iquit
>  mywnd.CLS
>  RELEASE mywnd
>  RELEASE WINDOWS Superwnd
>  SET CURSOR ON
>  ON ESCAPE
>  WAIT CLEAR
>  CANCEL
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform