Browse Source

lighting tests

pixelbath 1 year ago
parent
commit
74cf86a821
1 changed files with 52 additions and 0 deletions
  1. 52 0
      dark/lighttest.lua

+ 52 - 0
dark/lighttest.lua

@@ -0,0 +1,52 @@
+-- title:   Dark - lighting test
+-- author:  pixelbath
+-- desc:    lighting test
+-- site:    website link
+-- license: MIT License
+-- version: 0.1
+-- script:  lua
+
+function draw_base()
+    spr(256, 30, 20, 0, 1, 0, 0, 2, 2)
+    spr(256, 90, 60, 0, 1, 0, 0, 2, 2)
+    spr(258, 150, 80, 0, 1, 0, 0, 2, 2)
+end
+
+function draw_lighting()
+    local mx,my,lmb = mouse()
+    if lmb then return end
+
+    for i=0,32265 do
+        x=i % 240
+        y=i // 240
+        if pix(x, y) == 12 and pix(x+1, y-1) == 0 then
+            pix(x, y, 2)
+        else
+            pix(x, y, 0)
+        end
+    end
+end
+
+function TIC()
+    cls(0)
+    draw_base()
+    draw_lighting()
+end
+
+
+
+-- <SPRITES>
+-- 000:00000000000000cc00000ccc0000cccc000ccccc000ccccc000ccccc000ccccc
+-- 001:00000000cc000000ccc00000cccc0000ccccc000ccccc000ccccc000ccccc000
+-- 002:0000cccc000ccccc000c000c00000000000000000000000000000000000ccc00
+-- 003:cc000000cccc0000cccc0000cccc000000ccc000000cccc0000cccc00000ccc0
+-- 016:0000cccc00000ccc000000cc0000000000000000000000000000000000000000
+-- 017:cccc0000ccc00000cc0000000000000000000000000000000000000000000000
+-- 018:000cccc0000cccc0000cccc00000ccc000000000000000000000000000000000
+-- 019:00000cc000000cc0ccc00cc0ccc00cc0ccc00cc000000c000000000000000000
+-- </SPRITES>
+
+-- <PALETTE>
+-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
+-- </PALETTE>
+