|
Post by Scott Brosious on Jul 10, 2004 10:10:35 GMT -5
' This program can be used for flight paths of sprites, particles ect... ' It is meant to give more than just the basic movements of older type games. ' Apply it to games and what not. ' All of them wrap around enen if they don't look that way.
TextMode (TEXT_OVERLAID) printr "2D-Trajectories"
const width = 320 const height = 200 const pi# = 3.14
' Try different variations of xstep and ystep for new patterns. ' Examples: 3,4 3,5 3,6 4,3 4,5 5,3 5,4 Experiment!
const xstep = 5 const ystep = 6
dim costable#(6280) dim sintable#(6280)
dim ang# dim inc# dim num dim xcntr,ycntr dim xdis,ydis dim startx,starty dim x#,y#
xcntr = width / 2 ycntr = height / 2
xdis = xcntr / 2 ydis = ycntr / 2
for num = 1 to 6280
costable#(num) = cos(ang#) sintable#(num) = sin(ang#)
ang# = ang# + .001
next
glMatrixMode (GL_PROJECTION) glLoadIdentity () glOrtho (0, width, 0, height, -1, 1) glMatrixMode (GL_MODELVIEW)
glClearColor(0,0,0,1)
glClear (GL_COLOR_BUFFER_BIT)
startx = 1 starty = 1
glBegin (GL_POINTS) for num = 1 to 6280 x# = costable#(startx) y# = sintable#(starty) glColor4f (1,1,1,1) glVertex2f (x# * xdis + xcntr, y# * ydis + ycntr) startx = startx + xstep starty = starty + ystep
if startx > 6280 - xstep then startx = 1 endif if starty > 6280 - ystep then starty = 1 endif next glEnd ()
DrawText()
SwapBuffers ()
|
|