Page 1 of 1

Frequency (super simple fun!)

Posted: Sat Sep 03, 2016 3:18 pm
by DrChip

Code: Select all

REM frequency



'g'
init:
GRAPHICS
sw=SCREEN_WIDTH()
sh=SCREEN_HEIGHT()
noise=100
sections = 100
''
'b'
LOOP:
GRAPHICS CLEAR 0,0,0
REFRESH OFF
GOSUB hud 
   x=sw/2!y=0
   DRAW LINE x,0 TO x,0
   FOR y = 0 TO sh STEP sh/sections
      DRAW LINE TO x+RND(noise),y
   NEXT y
REFRESH ON
GOTO LOOP
END
''
'r'
hud:
DRAW TEXT "X: "&x AT 0,0
DRAW TEXT "Y: "&y AT 0,20
DRAW TEXT "NOISE: "&noise AT 0,40
DRAW TEXT "SECTIONS: "&sections AT 0,60
RETURN
''

Re: Frequency (super simple fun!)

Posted: Sat Sep 03, 2016 10:05 pm
by Henko
I don't HEAR the noise ? ;)

Re: Frequency (super simple fun!)

Posted: Mon Sep 05, 2016 11:51 pm
by rbytes
I agree. I think a great cmbination could be made of the code in this post and another recent post called Frequency that has an adjustable oscillator.

What the heck, not much to do this Labor Day weekend. I will post it today.