Browse Source

some awesome example code

pixelbath 2 years ago
parent
commit
bdc57c930e
4 changed files with 299 additions and 0 deletions
  1. 15 0
      awesome/screenmelt.lua
  2. 115 0
      awesome/screenshake.lua
  3. 79 0
      awesome/tvstatic.lua
  4. 90 0
      awesome/water.lua

+ 15 - 0
awesome/screenmelt.lua

@@ -0,0 +1,15 @@
+-- title:  melty
+-- author: pixelbath
+-- desc:   reference for screen melt effect
+
+function TIC()
+	for x=1,238 do
+		for y=1,134 do
+			if math.random()>0.55 then
+				dx = math.random(-1,1)
+				dy = math.random(-1,1)
+				pix(x ,y , pix(x + dx,y + dy))
+			end
+		end
+	end
+end

+ 115 - 0
awesome/screenshake.lua

@@ -0,0 +1,115 @@
+-- title:  shaker
+-- author: pixelbath
+-- desc:   reference for screenshake effect
+
+shake=0
+
+wobbleDirection = 0
+shakeAmount = 0
+
+function wobbleScreen()
+	shakeAmount=math.max(0,(shakeAmount-0.5))
+	if shakeAmount>0 then
+		t=time()/20
+		offsetX=shakeAmount*math.cos(wobbleDirection)*math.sin(t)
+		offsetY=shakeAmount*math.sin(wobbleDirection)*math.sin(t)
+		poke(0x3ff9, offsetX)
+		poke(0x3ffa, offsetY)
+	end
+end
+
+function TIC()
+	cls()
+	map()
+	print("Press B to shake!", 60, 100)
+	if btnp(5) then
+		shakeAmount=shakeAmount+10
+		wobbleDirection=math.random()*2*math.pi
+	end
+
+	shakeScreen()
+end
+
+
+-- <TILES>
+-- 000:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 001:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 002:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 003:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 004:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
+-- 005:a44444aaa4444444a4444444aa444444aa444444a44444444444444444444444
+-- 006:aaaaaaaa4aaaaaaa44aaaaaa44aaaaaa44aaaaaa44aaaaaa444aaaaa444aaaa4
+-- 007:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444aaaaa4444aa444444aa
+-- 016:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 017:aaaaaaaaaaaaaaaaaaaaaaaaccccccccccccccccccccccc2cccccc22ccccc222
+-- 018:aaaaaaaaaaaaaaaaaaaaaaaacccccccccccccccc2ccccccc22cccccc222ccccc
+-- 019:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 020:aaaaaa44aaaaaa44aaaaa444aaaaa444aaa44444aaa44444aaa44444aaa44444
+-- 021:44444444444444444444444444444444444444444444a4444aaaaa444aaaaaa4
+-- 022:4444a44444444444444444444444444444444444444444444444444444444444
+-- 023:4444aaaa4444aaaa4444aaaa4444aaaa4444aaaa44444aaa444444aa444444aa
+-- 032:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 033:ccccc222cccccc22ccccccc2ccccccccccccccccaaaaaaaaaaaaaaaaaaaaaaaa
+-- 034:222ccccc22cccccc2cccccccccccccccccccccccaaaaaaaaaaaaaaaaaaaaaaaa
+-- 035:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 036:aaa44444aaaaa444aaaaaaaaaaa4444aaaa4444aaaa44444aaa44444aaa44444
+-- 037:4aaaaaa44aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4aaaaaaa444aaaaa444aaaaa
+-- 038:4444444a444444aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 039:aaaa44aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 048:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 049:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 050:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 051:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4aaaaaaa4aaaaaaa4
+-- 052:aaaa4444aaaa4444aaaa4444aaa44444aaa444444aa444444a44444444444444
+-- 053:444aaaaa444aaaaa444aaaaa44aaaaaa44aaaaaa44aaaaaa44aaaaaa4aaaaaaa
+-- 054:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 055:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 064:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 065:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 066:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 067:aaaaaaaaaa444aaaaa44444aaaa44444aaa444a4aaa44444aaa44444aaa44444
+-- 068:a4444444a4444444444444444444444444444444444444444444444444444444
+-- 069:4aaaaaaa4aaaaaaa4aaaaaaa44aaaaaa444aaaaa444aaaaa444aaaaa444aaaaa
+-- 070:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 071:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 080:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 081:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444
+-- 082:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4aa4444a4aa444444aa44444444444444
+-- 083:aa444444a4444444a444444444444444444444444444444444444a44aaaaaaaa
+-- 084:444444444444444444444444444444444444a444444aaaaa44aaaaaaaaaaaaaa
+-- 085:444aaaaa44aaaaaa4aaaaaaa4aaaaaaa4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 086:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 087:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 096:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 097:aaaaa444aaaaa444aaaaa444aaaaa444444444aa444444aa4444444444444444
+-- 098:4444444444444444444444444a444444aa444444aa444444aa44444aaaaaaaaa
+-- 099:aaaaaaaa4aaaaaaa4aaaaaaa4aaaaaaa4aaaaaaa4aaaaaaaaaaaaaaaaaaaaaaa
+-- 100:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 101:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 102:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 103:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 112:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 113:aa444444aa444444aa444444a4444444a444444aa4444aaaa4444aaaaaaaaaaa
+-- 114:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 115:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 116:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 117:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 118:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- 119:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+-- </TILES>
+
+-- <MAP>
+-- 004:000000000000000000000000102030405060700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 005:000000000000000000000001112131415161710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 006:000000000000000000000002122232425262720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 007:000000000000000000000003132333435363730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 008:000000000000000000000004142434445464740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 009:000000000000000000000005152535455565750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 010:000000000000000000000006162636465666760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 011:000000000000000000000007172737475767770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- </MAP>
+
+-- <PALETTE>
+-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
+-- </PALETTE>
+

+ 79 - 0
awesome/tvstatic.lua

@@ -0,0 +1,79 @@
+-- title:  tv static
+-- author: pixelbath
+-- desc:   reference for tv static effect
+
+rnd=math.random
+
+-- introduce wobble by scanlines
+function SCN(sl)
+	t=time()/300
+	poke(0x03FF9,math.sin(t+sl/10)*3)
+end
+
+function tv()
+	-- add static
+	for i=1,10000 do
+		pix(rnd(0,239), rnd(0,135), 0)
+	end
+	-- add scanlines
+	for y=0,136,2 do
+		line(0,y,239,y,0)
+	end
+	t=-time()/10
+	y=t%136
+	line(0,y,239,y,15)
+	y=(2*t)%200
+	line(0,y,239,y,15)
+end
+
+function TIC()
+	-- TODO: make these color bars programmatic
+	map()
+	print("TEST",80,50,0,false,4)
+	--rect(60,80,50,20,8)
+	tv()
+end
+
+-- <TILES>
+-- 000:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+-- 001:4444444444444444444444444444444444444444444444444444444444444444
+-- 002:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+-- 003:6666666666666666666666666666666666666666666666666666666666666666
+-- 004:1111111111111111111111111111111111111111111111111111111111111111
+-- 005:2222222222222222222222222222222222222222222222222222222222222222
+-- 006:9999999999999999999999999999999999999999999999999999999999999999
+-- 016:9999999999999999999999999999999999999999999999999999999999999999
+-- 018:2222222222222222222222222222222222222222222222222222222222222222
+-- 020:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+-- 022:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+-- 035:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+-- 036:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 037:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+-- 038:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+-- </TILES>
+
+-- <MAP>
+-- 000:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 001:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 002:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 003:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 004:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 005:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 006:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 007:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 008:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 009:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 010:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 011:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 012:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 013:000010101010101020202020203030303030404040404050505050506060600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 014:010111111111111121212121213131313131414141414151515151516100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 015:000042424242424242424242425252525252525252525262626262626262000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 016:000042424242424242424242425252525252525252525262626262626262000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 017:000000000000424200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- </MAP>
+
+-- <PALETTE>
+-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
+-- </PALETTE>
+

+ 90 - 0
awesome/water.lua

@@ -0,0 +1,90 @@
+-- title:  water
+-- author: pixelbath
+-- desc:   reference for water effect
+
+-- create a mapping for darkening palette colors
+-- note: this is for the default sweetie16 palette
+drk={[0]=0,0,1,2,3,6,7,15,0,8,9,10,13,14,15,0}
+
+function drawStars(count, seed)
+	math.randomseed(seed)
+	for i=1, count do
+		x=math.random(0,239)
+		y=math.random(0,68)
+		r=math.random(0,1)
+		pix(x, y, 12)
+	end
+end
+
+function doWater(posY)
+	t=time()/200
+	for x=0,239 do
+		for y=posY,135 do
+			-- introduce some wobble
+			ox=x+2*math.sin(t+y)
+			oy=posY-(y-posY)-1
+			oc=pix(ox,oy)
+			-- darken reflected pixel
+			pix(x,y,drk[oc])
+		end
+	end
+end
+
+function TIC()
+	cls(15)
+	drawStars(25, 0)
+
+	map(0,0,30,17,0,0,0)
+
+	doWater(68)
+end
+
+
+-- <TILES>
+-- 066:0000000000000000000000000000000000000007000000070000000700000007
+-- 067:0000000000000000000000000000000070000000770000007700000077000000
+-- 081:0000000000000000007700000077000000770000077770000777700007777000
+-- 082:0000007700000077000000770000077700000777000077770000777700007777
+-- 083:7770000077700000777000007770000077770000777700007777700777777007
+-- 084:0770000007700000777000007770000077700000777000007777000077770007
+-- 085:0000000000000000000000000000000077000000777000007777000077770000
+-- 096:0000000000000000000000000000000d00000ddd000ddddd00dddddddddddddd
+-- 097:77777700777777dd777777dd7777777d7777777d7777777d7777777d7777777d
+-- 098:0dd77777ddd77777dd777777dd777777dd777777dd777777dd777777dd777777
+-- 099:77777dd777777dd777777dd777777dd777777ddd77777ddd77777ddd77777ddd
+-- 100:7777000777770077777700777777dd777777dd77dddddd77dddddd77dddddd77
+-- 101:77777000777770007777700077777000777770007777700077777d0077777ddd
+-- 105:00000000000000000000000000000000000000000000000000000000000000dd
+-- 106:0000000000000000000000000000000d0000dddd00dddddddddddddddddddddd
+-- 107:000000000000000000000000dddddddddddddddddddddddddddddddddddddddd
+-- 108:000000000000000000000000dd000000ddddd000ddddddd0dddddddddddddddd
+-- 112:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 113:dd777ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 114:dd777777ddd77777ddddd777dddddddddddddddddddddddddddddddddddddddd
+-- 115:77777ddd7777dddd7ddddddddddddddddddddddddddddddddddddddddddddddd
+-- 116:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 117:777ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 118:ddd00000dddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 119:00000000d0000000dddddddddddddddddddddddddddddddddddddddddddddddd
+-- 120:0000000000000000dddddddddddddddddddddddddddddddddddddddddddddddd
+-- 121:000ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 122:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 123:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 124:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+-- 125:d0000000dd000000dddd0000dddddd00dddddddddddddddddddddddddddddddd
+-- 126:00000000000000000000000000000000dd000000ddddd000dddddddddddddddd
+-- 127:000000000000000000000000000000000000000000000000d0000000dddd0000
+-- </TILES>
+
+-- <MAP>
+-- 004:03132333435363738393a3b3c3d3e3f30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 005:04142434445464748494a4b4c4d4e4f40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 006:05152535455565758595a5b5c5d5e5f50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 007:06162636465666768696a6b6c6d6e6f60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- 008:07172737475767778797a7b7c7d7e7f70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- </MAP>
+
+-- <PALETTE>
+-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
+-- </PALETTE>
+