Qbasicnews.com

Full Version: green bubbles of plazma acid stuff!!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i made this green plasma junk, i found the algo and adjusted it a bit to make it look "cooler"

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
Wow, very nice! I need to learn how to make plasmas sometime. Smile

Anonymous

cool =)

check this:

Code:
Screen 18,32,2

Dim As Integer Ptr scn
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_sequence 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

scn = ScreenPtr

plasma_speed = 2             'speed of plasma bubble sequance


While Inkey$ = ""            'start loop here, and end loop if there's keypress
  
  plaz_sequence = plaz_sequence + plasma_speed          'sequance the plasma at a set speed
  
  ScreenLock
  
    For scrn_xpos = 0 To screen_width
      
        For scrn_ypos = 200 To screen_height
          
            plaz_color = Abs(Cos((scrn_xpos + plaz_sequence) * 4 / plas_Xsize) + Sin((scrn_ypos + plaz_sequence) * 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    
            scn [scrn_ypos * screen_width + scrn_xpos] = 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
  
  ScreenUnlock

Wend

=D
Code:
Screen 18,32,2

Dim As Integer Ptr scn
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_sequence As Integer 'sequances the plasma to give it bubbling effect

screen_width = 640           'width of plasma area
screen_height = 480          'height of plasma area

plas_Xsize = 180             'width of single plasma bubble
plas_Ysize = 100             'height of single plasma bubble

scn = ScreenPtr

plasma_speed = 1             'speed of plasma bubble sequance


While Inkey$ = ""            'start loop here, and end loop if there's keypress
  
  plaz_sequence = plaz_sequence + plasma_speed          'sequance the plasma at a set speed

  ScreenLock

    For scrn_xpos = 0 To screen_width
      
        For scrn_ypos = 0 To screen_height
          
            plaz_color = Abs(Cos((scrn_xpos + plaz_sequence) * 4 / plas_Xsize) + Sin((scrn_ypos + plaz_sequence) * 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    
            scn [scrn_ypos * screen_width + scrn_xpos] = Rgb(0, plaz_color * 800 / 50.1, 0 )      'draw pixels!!!!!! (xpos,ypos), color    
          
            scrn_ypos = scrn_ypos + 1                            'makes it skip everyother line, adds speed!!!
  
        Next scrn_ypos
    
    scrn_xpos = scrn_xpos + 1                            'makes it skip everyother line, adds speed!!!
      
    Next scrn_xpos

  ScreenUnlock
      ? plaz_color * 800 / 50

Wend
scary lookin....
@ dumbledore: it runs better w/o " ? plaz_color * 800 / 50 " or if you must, using: "LOCATE 1, 1: ? plaz_color * 800 / 50" does it alot better also ... cause once it prints at the bottum of the screen, it gets all jumpy and slow... at least for me... :wink:
Code:
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

*sigh*
I wish i knew more trig i have absolutly no idea what this means. the only thing i can tell about this is that it has somthing to do with a circle (I think)
and the only reason i know that is because i took a little bit of trig from a website i saw...

Oh btw that would make an awsome screensaver
Quote:
Code:
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

*sigh*
I wish i knew more trig i have absolutly no idea what this means. the only thing i can tell about this is that it has somthing to do with a circle (I think)
and the only reason i know that is because i took a little bit of trig from a website i saw...

Oh btw that would make an awsome screensaver

yeah and i heard trig is easy.
Very cool. A definite screensaver candidate.
thanks!!! :bounce: