SHARE
TWEET

Codify bzone retro background

a guest Oct 30th, 2011 245 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. -- Use this function to perform your initial setup
  4. function setup()
  5.     print("Hello World!")
  6.     background(0,0,0,0)
  7.     --stroke(255, 255, 0, 135)
  8.     stroke(59)
  9.     strokeWidth(10)
  10.     peaks = {}
  11.     sdeg = 1
  12.     sheight = 2
  13.     edeg = 3
  14.     eheight = 4
  15.     parameter("oclock",0,12)
  16.     parameter("aim",0,30)
  17.     peaks[1] = {}
  18.     peaks[1][sdeg] = 0
  19.     peaks[1][sheight] = 0
  20.     peaks[1][edeg] = 1.2
  21.     peaks[1][eheight] = 6 
  22.     peaks[2] = {}
  23.     peaks[2][sdeg] = 1.2
  24.     peaks[2][sheight] = 6
  25.     peaks[2][edeg] = 1.6
  26.     peaks[2][eheight] = 0 
  27.     peaks[3] = {}
  28.     peaks[3][sdeg] = 1.2
  29.     peaks[3][sheight] = 6
  30.     peaks[3][edeg] = 3.2
  31.     peaks[3][eheight] = 0 
  32.     peaks[4] = {}
  33.     peaks[4][sdeg] = 2
  34.     peaks[4][sheight] = 3.5
  35.     peaks[4][edeg] = 3.5
  36.     peaks[4][eheight] = 6 
  37.     peaks[5] = {}
  38.     peaks[5][sdeg] = 3.5
  39.     peaks[5][sheight] = 6
  40.     peaks[5][edeg] = 4.5
  41.     peaks[5][eheight] = 3.5 
  42.     peaks[6] = {}
  43.     peaks[6][sdeg] = 3.5
  44.     peaks[6][sheight] = 6
  45.     peaks[6][edeg] = 8
  46.     peaks[6][eheight] = 0
  47.     peaks[7] = {}
  48.     peaks[7][sdeg] = 4.5
  49.     peaks[7][sheight] = 3.5
  50.     peaks[7][edeg] = 7
  51.     peaks[7][eheight] = 0 
  52.     numpeaks = 7
  53. end
  54.  
  55. -- This function gets called once every frame
  56. function draw()
  57.     background(0,0,0,0)
  58.     stroke(0, 255, 0, 135)
  59.     strokeWidth(3)
  60.     line(0, HEIGHT / 2, WIDTH, HEIGHT / 2)
  61.     curdegree = (oclock * 30) + aim
  62.     for i = 1, numpeaks do
  63.         asd = math.fmod(360+(peaks[i][sdeg] - curdegree + 10),360)
  64.         esd = math.fmod(360+(peaks[i][edeg] - curdegree + 10),360)
  65.         sd = WIDTH * asd / 20
  66.         ed = WIDTH * esd / 20
  67.         sh = (HEIGHT / 2) + ((peaks[i][sheight] / 100) * HEIGHT)
  68.         eh = (HEIGHT / 2) + ((peaks[i][eheight] / 100) * HEIGHT)
  69.         if asd < 25 and esd < 25 then
  70.             line(sd, sh, ed, eh)
  71.         end
  72.     end
  73. end
  74.  
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top