lighttest.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. -- title: Dark - lighting test
  2. -- author: pixelbath
  3. -- desc: lighting test
  4. -- site: website link
  5. -- license: MIT License
  6. -- version: 0.1
  7. -- script: lua
  8. function draw_base()
  9. spr(256, 30, 20, 0, 1, 0, 0, 2, 2)
  10. spr(256, 90, 60, 0, 1, 0, 0, 2, 2)
  11. spr(258, 150, 80, 0, 1, 0, 0, 2, 2)
  12. end
  13. function draw_lighting()
  14. local mx,my,lmb = mouse()
  15. if lmb then return end
  16. for i=0,32265 do
  17. x=i % 240
  18. y=i // 240
  19. if pix(x, y) == 12 and pix(x+1, y-1) == 0 then
  20. pix(x, y, 2)
  21. else
  22. pix(x, y, 0)
  23. end
  24. end
  25. end
  26. function TIC()
  27. cls(0)
  28. draw_base()
  29. draw_lighting()
  30. end
  31. -- <SPRITES>
  32. -- 000:00000000000000cc00000ccc0000cccc000ccccc000ccccc000ccccc000ccccc
  33. -- 001:00000000cc000000ccc00000cccc0000ccccc000ccccc000ccccc000ccccc000
  34. -- 002:0000cccc000ccccc000c000c00000000000000000000000000000000000ccc00
  35. -- 003:cc000000cccc0000cccc0000cccc000000ccc000000cccc0000cccc00000ccc0
  36. -- 016:0000cccc00000ccc000000cc0000000000000000000000000000000000000000
  37. -- 017:cccc0000ccc00000cc0000000000000000000000000000000000000000000000
  38. -- 018:000cccc0000cccc0000cccc00000ccc000000000000000000000000000000000
  39. -- 019:00000cc000000cc0ccc00cc0ccc00cc0ccc00cc000000c000000000000000000
  40. -- </SPRITES>
  41. -- <PALETTE>
  42. -- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
  43. -- </PALETTE>