Advertisement
crabb

no good screen recorder exists

Nov 5th, 2020
2,211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. local t = 0
  2.  
  3. sline = function(x1,y1,x2,y2,tex)
  4.     local sx = abs(flr(x2)-flr(x1))
  5.     local sy = abs(flr(y2)-flr(y1))
  6.     local steps = max(sx,sy)
  7.  steps = 32
  8.    
  9.     local tx = (#tex+1)/steps
  10.     local dx = (x2-x1)/steps
  11.     local dy = (y2-y1)/steps
  12.     local ti = 0
  13.     for i=0,steps do
  14.         pset(x1,y1,tex[flr(ti)])
  15.         x1 += dx + sin((t*4)+y1/64)
  16.         y1 += dy + cos((t*4)+x1/32)
  17.         ti += tx
  18.     end
  19. end
  20.  
  21. function _update60()
  22.     t += 0x0.0080
  23. end
  24. function _draw()
  25.  cls(0)
  26.  local tex = {
  27.     [0]=1,2,14,15,7
  28.  }
  29.  for a = t,t+1,0x0.0c do
  30.         local x0 = 64 + cos(t)*8
  31.         local y0 = 64 + sin(t)*8
  32.         local x1 = 96
  33.         local y1 = 64
  34.         local px0 = x0 + cos(a)*64
  35.         local py0 = y0 + sin(a)*64
  36.         local px1 = x1 + cos(a)*32
  37.         local py1 = y1 + sin(a)*32
  38.         sline(x0,y0,px0,py0,tex)
  39.         --line(x1,y1,px1,py1,7)
  40.     end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement