08-28-2005, 09:53 AM
i made this green plasma junk, i found the algo and adjusted it a bit to make it look "cooler"
tell me what you think
Code:
SCREEN 18,32,2
dim screen_width as single
dim screen_height as single
dim plasma_speed as single
dim scrn_xpos as integer 'x position of plasma area
dim scrn_ypos as integer 'y position of plasma area
dim plaz_color as integer 'effects the color of the plasma (and maybe more)
dim plaz_sequance as integer 'sequances the plasma to give it bubbling effect
screen_width = 640 'width of plasma area
screen_height = 300 'height of plasma area
plas_Xsize = 180 'width of single plasma bubble
plas_Ysize = 100 'height of single plasma bubble
plasma_speed = 2 'speed of plasma bubble sequance
while inkey$ = "" 'start loop here, and end loop if there's keypress
plaz_sequance = plaz_sequance + plasma_speed 'sequance the plasma at a set speed
FOR scrn_xpos = 0 TO screen_width
FOR scrn_ypos = 200 TO screen_height
plaz_color = ABS(COS((scrn_xpos + plaz_sequance) * 4 / plas_Xsize) + sin((scrn_ypos + plaz_sequance) * 4 / plas_Ysize) + cos((scrn_xpos + scrn_ypos) * 1 / 23)) * 5 / 1 + 16
PSET (scrn_xpos , scrn_ypos), RGB(0, plaz_color * 800 / 50, 0) 'draw pixels!!!!!! (xpos,ypos), color
scrn_ypos = scrn_ypos + 1 'makes it skip everyother line, adds speed!!!
NEXT scrn_ypos
NEXT scrn_xpos
wend
tell me what you think